lkml.org 
[lkml]   [2014]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] can: Fix bug in suspend/resume
On 11/13/2014 12:32 PM, Lothar Waßmann wrote:
>>>> static int __maybe_unused xcan_suspend(struct device *dev) {
>>>> - struct platform_device *pdev = dev_get_drvdata(dev);
>>>> + struct platform_device *pdev = container_of(dev,
>>>> + struct platform_device, dev);
>>>> struct net_device *ndev = platform_get_drvdata(pdev);
>>>> struct xcan_priv *priv = netdev_priv(ndev);
>>
> Why not simply:
> struct net_device *ndev = dev_get_drvdata(dev);
>
> There is no need for a struct platform_device* at all.

ACK

Marc

--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2014-11-13 13:41    [W:0.076 / U:1.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site