lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 23 Apr 2018 07:46:31 +0200
From:   Ludovic Desroches <ludovic.desroches@...rochip.com>
To:     Wolfram Sang <wsa+renesas@...g-engineering.com>
CC:     <dmaengine@...r.kernel.org>,
        Ludovic Desroches <ludovic.desroches@...rochip.com>,
        Vinod Koul <vinod.koul@...el.com>,
        Dan Williams <dan.j.williams@...el.com>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/6] dmaengine: at_xdmac: simplify getting .drvdata

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@...g-engineering.com>
Acked-by: Ludovic Desroches <ludovic.desroches@...rochip.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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ