public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ludovic Desroches <ludovic.desroches@microchip.com>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: <dmaengine@vger.kernel.org>,
	Ludovic Desroches <ludovic.desroches@microchip.com>,
	Vinod Koul <vinod.koul@intel.com>,
	Dan Williams <dan.j.williams@intel.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/6] dmaengine: at_xdmac: simplify getting .drvdata
Date: Mon, 23 Apr 2018 07:46:31 +0200	[thread overview]
Message-ID: <20180423054631.GF13305@rfolt0960.corp.atmel.com> (raw)
In-Reply-To: <20180422091415.7587-3-wsa+renesas@sang-engineering.com>

On Sun, Apr 22, 2018 at 11:14:10AM +0200, Wolfram Sang wrote:
> We should get drvdata from struct device directly. Going via
> platform_device is an unneeded step back and forth.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>

Thanks
> ---
> 
> Build tested only. buildbot is happy. Please apply to your tree directly.
> 
>  drivers/dma/at_xdmac.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c
> index 94236ec9d410..4bf72561667c 100644
> --- a/drivers/dma/at_xdmac.c
> +++ b/drivers/dma/at_xdmac.c
> @@ -1833,8 +1833,7 @@ static void at_xdmac_free_chan_resources(struct dma_chan *chan)
>  #ifdef CONFIG_PM
>  static int atmel_xdmac_prepare(struct device *dev)
>  {
> -	struct platform_device	*pdev = to_platform_device(dev);
> -	struct at_xdmac		*atxdmac = platform_get_drvdata(pdev);
> +	struct at_xdmac		*atxdmac = dev_get_drvdata(dev);
>  	struct dma_chan		*chan, *_chan;
>  
>  	list_for_each_entry_safe(chan, _chan, &atxdmac->dma.channels, device_node) {
> @@ -1853,8 +1852,7 @@ static int atmel_xdmac_prepare(struct device *dev)
>  #ifdef CONFIG_PM_SLEEP
>  static int atmel_xdmac_suspend(struct device *dev)
>  {
> -	struct platform_device	*pdev = to_platform_device(dev);
> -	struct at_xdmac		*atxdmac = platform_get_drvdata(pdev);
> +	struct at_xdmac		*atxdmac = dev_get_drvdata(dev);
>  	struct dma_chan		*chan, *_chan;
>  
>  	list_for_each_entry_safe(chan, _chan, &atxdmac->dma.channels, device_node) {
> @@ -1878,8 +1876,7 @@ static int atmel_xdmac_suspend(struct device *dev)
>  
>  static int atmel_xdmac_resume(struct device *dev)
>  {
> -	struct platform_device	*pdev = to_platform_device(dev);
> -	struct at_xdmac		*atxdmac = platform_get_drvdata(pdev);
> +	struct at_xdmac		*atxdmac = dev_get_drvdata(dev);
>  	struct at_xdmac_chan	*atchan;
>  	struct dma_chan		*chan, *_chan;
>  	int			i;
> -- 
> 2.11.0
> 

  reply	other threads:[~2018-04-23  5:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-22  9:14 [PATCH 0/6] tree-wide: simplify getting .drvdata Wolfram Sang
2018-04-22  9:14 ` [PATCH 1/6] dmaengine: at_hdmac: " Wolfram Sang
2018-04-23  5:46   ` Ludovic Desroches
2018-04-22  9:14 ` [PATCH 2/6] dmaengine: at_xdmac: " Wolfram Sang
2018-04-23  5:46   ` Ludovic Desroches [this message]
2018-04-22  9:14 ` [PATCH 3/6] dmaengine: fsldma: " Wolfram Sang
2018-04-22  9:14 ` [PATCH 4/6] dmaengine: idma64: " Wolfram Sang
2018-04-22  9:14 ` [PATCH 5/6] dmaengine: ste_dma40: " Wolfram Sang
2018-04-22  9:14 ` [PATCH 6/6] dmaengine: txx9dmac: " Wolfram Sang
2018-04-22 16:11 ` [PATCH 0/6] tree-wide: " Vinod Koul

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=20180423054631.GF13305@rfolt0960.corp.atmel.com \
    --to=ludovic.desroches@microchip.com \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vinod.koul@intel.com \
    --cc=wsa+renesas@sang-engineering.com \
    /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