From: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
To: Nipun Gupta <nipun.gupta-3arQi8VN3Tc@public.gmane.org>
Cc: zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
david.brown-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
hch-jcswGhMUV9g@public.gmane.org,
vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
rafael.j.wysocki-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org,
andy.gross-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
msuchanek-l3A5Bk7waGM@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
johan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
linux-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
leoyang.li-3arQi8VN3Tc@public.gmane.org,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2 1/2] dma-mapping: move dma configuration to bus infrastructure
Date: Thu, 22 Mar 2018 09:15:30 +0100 [thread overview]
Message-ID: <20180322081530.GA29444@lst.de> (raw)
In-Reply-To: <1521615323-4752-1-git-send-email-nipun.gupta-3arQi8VN3Tc@public.gmane.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.
next prev parent reply other threads:[~2018-03-22 8:15 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1520868292-2479-1-git-send-email-nipun.gupta@nxp.com>
[not found] ` <1520868292-2479-1-git-send-email-nipun.gupta-3arQi8VN3Tc@public.gmane.org>
2018-03-21 6:55 ` [PATCH v2 1/2] dma-mapping: move dma configuration to bus infrastructure Nipun Gupta
[not found] ` <1521615323-4752-1-git-send-email-nipun.gupta-3arQi8VN3Tc@public.gmane.org>
2018-03-21 6:55 ` [PATCH v2 2/2] drivers: remove force dma flag from buses Nipun Gupta
[not found] ` <1521615323-4752-2-git-send-email-nipun.gupta-3arQi8VN3Tc@public.gmane.org>
2018-03-21 9:35 ` Greg KH
[not found] ` <20180321093525.GT14085-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2018-03-21 16:28 ` Nipun Gupta
[not found] ` <HE1PR0401MB2425644F72A063ED42B79D5FE6AA0-B0v07Ae2taqTjcJO+iVGAo3W/0Ik+aLCnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2018-03-21 17:49 ` Greg KH
2018-03-22 8:19 ` Christoph Hellwig
[not found] ` <20180322081926.GC29444-jcswGhMUV9g@public.gmane.org>
2018-03-22 15:13 ` Nipun Gupta
2018-03-23 16:09 ` kbuild test robot
2018-03-23 17:41 ` kbuild test robot
2018-03-21 7:19 ` [PATCH v2 1/2] dma-mapping: move dma configuration to bus infrastructure Bharat Bhushan
[not found] ` <AM5PR0401MB254503027680DE6A23355D909AAA0-oQ3wXcTHOqrg6d/1FbYcvI3W/0Ik+aLCnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2018-03-21 7:29 ` Nipun Gupta
2018-03-22 8:17 ` hch-jcswGhMUV9g
2018-03-21 9:29 ` Greg KH
[not found] ` <20180321092954.GS14085-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2018-03-21 16:13 ` Nipun Gupta
2018-03-22 8:15 ` Christoph Hellwig [this message]
[not found] ` <20180322081530.GA29444-jcswGhMUV9g@public.gmane.org>
2018-03-22 15:05 ` Nipun Gupta
2018-03-24 9:25 ` kbuild test robot
2018-03-30 7:54 ` [PATCH v3 " Nipun Gupta
[not found] ` <1522396485-10248-1-git-send-email-nipun.gupta-3arQi8VN3Tc@public.gmane.org>
2018-03-30 7:54 ` [PATCH v3 2/2] drivers: remove force dma flag from buses Nipun Gupta
[not found] ` <1522396485-10248-2-git-send-email-nipun.gupta-3arQi8VN3Tc@public.gmane.org>
2018-04-09 20:27 ` Rob Herring
2018-04-10 19:21 ` Bjorn Helgaas
2018-04-23 12:56 ` [PATCH v3 1/2] dma-mapping: move dma configuration to bus infrastructure Christoph Hellwig
[not found] ` <20180423125638.GB8824-jcswGhMUV9g@public.gmane.org>
2018-04-27 17:10 ` Nipun Gupta
2018-04-10 19:20 ` Bjorn Helgaas
[not found] ` <20180410192041.GA54986-1RhO1Y9PlrlHTL0Zs8A6p5iNqAH0jzoTYJqu5kTmcBRl57MIdRCFDg@public.gmane.org>
2018-04-23 12:56 ` Christoph Hellwig
2018-04-28 2:51 ` [PATCH v4 " Nipun Gupta
[not found] ` <1524883919-29484-1-git-send-email-nipun.gupta-3arQi8VN3Tc@public.gmane.org>
2018-04-28 2:51 ` [PATCH v4 2/2] drivers: remove force dma flag from buses Nipun Gupta
2018-05-01 12:34 ` Rob Herring
2018-05-03 16:36 ` Vinod Koul
2018-04-30 10:41 ` [PATCH v4 1/2] dma-mapping: move dma configuration to bus infrastructure Thierry Reding
2018-05-03 12:21 ` Christoph Hellwig
2018-05-03 12:21 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180322081530.GA29444@lst.de \
--to=hch-jcswghmuv9g@public.gmane.org \
--cc=andy.gross-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=david.brown-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=johan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=leoyang.li-3arQi8VN3Tc@public.gmane.org \
--cc=linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=msuchanek-l3A5Bk7waGM@public.gmane.org \
--cc=nipun.gupta-3arQi8VN3Tc@public.gmane.org \
--cc=rafael.j.wysocki-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).