Received: by 10.213.65.68 with SMTP id h4csp474466imn; Thu, 22 Mar 2018 01:16:49 -0700 (PDT) X-Google-Smtp-Source: AG47ELvGmkkamyIZO2Tu5ZXsuX8E3TowzYn+JCXRb0i9z3XY6/oV2EdYqsWDxDFfz+7Gzih7E8xa X-Received: by 2002:a17:902:34f:: with SMTP id 73-v6mr24139194pld.55.1521706609728; Thu, 22 Mar 2018 01:16:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521706609; cv=none; d=google.com; s=arc-20160816; b=O0Fs6l8/cdRwz4tth96yqehi2IUuYJAZ3Zy19/1fieSEUl+BqSoR1OmD7QOxLosp4B YhK7BrfaiqitwVwnH523thZgA+KIXe0zeAoIWqnPeAV4KIQ+6krlrlhRRLORiiZUHDcs ZXVbVzGULFNtmi+sPt/lOhOOVza5eiPUoywGgxAotGIeT4ur0epzyA4E9lFz/kUOoZhI 1tz+KjpJwVc3enaPyg/fIMg/Fy3as0rWnM+WUKgfd2gkKR/hyw/J8us9fKtNE8QGBX9b swjHXeB1/MIwVOdYv1erTv8rK+6NVUFeoZYFuHi5HeDYqt9LBvEn21IkkZ1e8CAyPjSe JJ8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=RVfeGvQhs0SthuXrfBw+pT+1Q4EmHFLcF+3FKvBtWgc=; b=0zWMwheXJNpyRigj6PgMdrr8o5F5hqGnRSmppivw5svSZBqqWFDuB9e8EgV4cbjK+7 VYAhAkeMY3QgMbJCMpYZ4W6jD+53zxjNdm4+guU8nkwMby2ZygcwcBoNx6D8+29gTG3s EMQ1Q4S769YhpV/W4AbLLWksPw/tr2yU9EmsPIOKIp21ksH+PxlxyINtan60kMrbMZ4k 2EA2HOYo+E3MlhzU1yvSJ/mCvYN2M1pY391iVUNmRn9K8QvxuAW3FGfDBWZm3EmB6GEH Yvmk6ktzsD9IPg05sAqqjnWg9RwcbOXKjKBvd7PwZ1FLFXncpPZeiQhZRcegcvEXZzvc WKQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13si4086829pgd.36.2018.03.22.01.16.32; Thu, 22 Mar 2018 01:16:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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 linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752620AbeCVIPh (ORCPT + 99 others); Thu, 22 Mar 2018 04:15:37 -0400 Received: from verein.lst.de ([213.95.11.211]:46071 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752476AbeCVIPd (ORCPT ); Thu, 22 Mar 2018 04:15:33 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 04913DE403; Thu, 22 Mar 2018 09:15:31 +0100 (CET) Date: Thu, 22 Mar 2018 09:15:30 +0100 From: Christoph Hellwig To: Nipun Gupta Cc: robin.murphy@arm.com, hch@lst.de, linux@armlinux.org.uk, gregkh@linuxfoundation.org, m.szyprowski@samsung.com, bhelgaas@google.com, zajec5@gmail.com, andy.gross@linaro.org, david.brown@linaro.org, dan.j.williams@intel.com, vinod.koul@intel.com, thierry.reding@gmail.com, robh+dt@kernel.org, frowand.list@gmail.com, jarkko.sakkinen@linux.intel.com, rafael.j.wysocki@intel.com, dmitry.torokhov@gmail.com, johan@kernel.org, msuchanek@suse.de, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, linux-wireless@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, dmaengine@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, linux-pci@vger.kernel.org, bharat.bhushan@nxp.com, leoyang.li@nxp.com Subject: Re: [PATCH v2 1/2] dma-mapping: move dma configuration to bus infrastructure Message-ID: <20180322081530.GA29444@lst.de> References: <1520868292-2479-1-git-send-email-nipun.gupta@nxp.com> <1521615323-4752-1-git-send-email-nipun.gupta@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1521615323-4752-1-git-send-email-nipun.gupta@nxp.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +static int amba_dma_configure(struct device *dev) > +{ > + return dma_common_configure(dev); > +} So it turns out we only end with two callers of dma_common_configure after this series. Based ont hat I'm tempted with the suggestion from Robin to just have amba call platform_dma_configure, and move the code from dma_common_configure to platform_dma_configure. > +int dma_configure(struct device *dev) > +{ > + if (dev->bus->dma_configure) > + return dev->bus->dma_configure(dev); > + > + return 0; > +} > void dma_deconfigure(struct device *dev) As grep pointed out this wants a blank line after the function, and while in nitpicking mode I'd suggest to remove the blank line above the return statement while at it. > diff --git a/drivers/gpu/host1x/bus.c b/drivers/gpu/host1x/bus.c > index 88a3558..fa9896d 100644 > --- a/drivers/gpu/host1x/bus.c > +++ b/drivers/gpu/host1x/bus.c > @@ -314,6 +314,14 @@ static int host1x_device_match(struct device *dev, struct device_driver *drv) > return strcmp(dev_name(dev), drv->name) == 0; > } > > +static int host1x_dma_configure(struct device *dev) > +{ > + if (dev->of_node) > + return of_dma_configure(dev, dev->of_node); > + > + return 0; Same here. > + */ > +static int pci_dma_configure(struct device *dev) > +{ > + struct device *bridge; > + enum dev_dma_attr attr; > + int ret = 0; > + > + bridge = pci_get_host_bridge_device(to_pci_dev(dev)); > + > + if (IS_ENABLED(CONFIG_OF) && bridge->parent && > + bridge->parent->of_node) { > + ret = of_dma_configure(dev, bridge->parent->of_node); > + } else if (has_acpi_companion(bridge)) { > + attr = acpi_get_dma_attr(to_acpi_device_node(bridge->fwnode)); > + if (attr != DEV_DMA_NOT_SUPPORTED) > + ret = acpi_dma_configure(dev, attr); > + } The attr declaration can be moved into the inner scope here. > + pci_put_host_bridge_device(bridge); > + > + return ret; Drop the blank line after the return, please.