From patchwork Fri Sep 27 00:24:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 174557 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2787553ill; Thu, 26 Sep 2019 17:25:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxHEWjLDYfRMkzGT6yENg72ka2zSyPng+jtZerBzxSuq1SvPFn6bKNMYmnXRqdIcgCNxvoH X-Received: by 2002:aa7:d611:: with SMTP id c17mr1741456edr.196.1569543920003; Thu, 26 Sep 2019 17:25:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569543919; cv=none; d=google.com; s=arc-20160816; b=srOJopCkccsAjDNmLCY1HqwpmlxBaAxLj6Qa3sc8zud+813hSAIV4Ya3vyfZ0lexCi 57PSlMWRHnUOoqTsQtUhYyq7iHlJ7Zs7+GF7MHKcgkl+XU4pIM0Dhb8H4cZ4Iw6aykXX Xucd3X+mL2iVdwKWJEsW0l3e75KnehmQCjoy+OB8eprugfcoAyq6Z3H/aWPdFNQnKgTE Ul5wcZD6uRj2BGTMUyn/+g/K8HeKgR6/PuUOtsjpZ8TLFWene5f5qd9Bpmsx8ZnXVoQi rkQGR/NLHR1M3KBOfeFXq5+V64WJdlxuc8DtaHxTvVn8tq3065x75/13ub3yEF9qxAJX vY8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=+Kwduh2L3Q3wglxQRQFNc0vVRF7aZPumhA9/VlLU+NE=; b=k4eIHdzktuj9tWQJcBF5qwfuHAP6wELgmIhNDD2EW8ffJKBPWk8l3nLTojLwCSXa2M X7zw2Ns6FCKRJnhWigLkIVnWRsKdXDDdhrQXlQeD+azszZKfOBORZUtFBTnAUm4DASDo UBi9GFIl6kJtOjSStpwy2r1OiL2Z/laLE/YA0VQhE8uRT2kJ0YOVsHiucviqUoAhaKIG I1Y/KlJPrTQroXP6TF67I4iou5+qZJc9twt+cZF5s5Iiluz9/q11JHQnJheqK3c64GgT b3aA6OH9pPRlCabKRBsi9ZNn3DgbmP5s4Q4b7SlcAbfhR8bNLH9/NIhShD2JNyLL8TWo 7DMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r2si1932925ejj.90.2019.09.26.17.25.19; Thu, 26 Sep 2019 17:25:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727857AbfI0AZI (ORCPT + 8 others); Thu, 26 Sep 2019 20:25:08 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:38700 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727777AbfI0AZH (ORCPT ); Thu, 26 Sep 2019 20:25:07 -0400 Received: by mail-oi1-f196.google.com with SMTP id m16so3747036oic.5; Thu, 26 Sep 2019 17:25:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+Kwduh2L3Q3wglxQRQFNc0vVRF7aZPumhA9/VlLU+NE=; b=mjhcUDE8XUiETIYkOZkncJVwXFfDn3+5OtMOKkMygQtL0EMH6+dzILudd6EoFv4LRt NFOVho6exq84wuyEEwcJayqJJ6hzsSz6HAQK1rgWBpW1V52UgdUZe3AHwUtVGOGK73Y+ aw0vdIsvkAPuEyEvBkTE3pZmOdTDD7jIw35WNmM9Bx/iLhYrfQCtF7sZ0k7O4VdRjGbC LV4eBoFPJeKw4wt+FWwOuntgjxUqw9mhdypHpHS2W5oyE5EoT2EUSW7YqLecLlAfMsWl lD+3oBlaBBxy4s1L0rVECGMI0c5BFFOXhHwwxeKXX0kWFzxrj9kvJ9bT72PyFp6Uf5fX UN/A== X-Gm-Message-State: APjAAAW8KwnBEzAcWpKg7+K+BIwbrJgcq/hMxW7G8FI6SvMK3qn+OlK/ 0U7Iss5M88wxi5UOZ4txzZdhKvY= X-Received: by 2002:aca:540a:: with SMTP id i10mr4633085oib.108.1569543906002; Thu, 26 Sep 2019 17:25:06 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id j11sm339866otk.80.2019.09.26.17.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 17:25:05 -0700 (PDT) From: Rob Herring To: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Nicolas Saenz Julienne , Robin Murphy , Florian Fainelli , Stefan Wahren , Frank Rowand , Arnd Bergmann , Marek Vasut , Geert Uytterhoeven , Simon Horman , Lorenzo Pieralisi , Oza Pawandeep Subject: [PATCH 06/11] of/address: Introduce of_get_next_dma_parent() helper Date: Thu, 26 Sep 2019 19:24:50 -0500 Message-Id: <20190927002455.13169-7-robh@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190927002455.13169-1-robh@kernel.org> References: <20190927002455.13169-1-robh@kernel.org> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Robin Murphy Add of_get_next_dma_parent() helper which is similar to __of_get_dma_parent(), but can be used in iterators and decrements the ref count on the prior parent. Signed-off-by: Robin Murphy Signed-off-by: Rob Herring --- drivers/of/address.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.20.1 diff --git a/drivers/of/address.c b/drivers/of/address.c index 53d2656c2269..e9188c82fdae 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -695,6 +695,16 @@ static struct device_node *__of_get_dma_parent(const struct device_node *np) return of_node_get(args.np); } +static struct device_node *of_get_next_dma_parent(struct device_node *np) +{ + struct device_node *parent; + + parent = __of_get_dma_parent(np); + of_node_put(np); + + return parent; +} + u64 of_translate_dma_address(struct device_node *dev, const __be32 *in_addr) { struct device_node *host;