[PATCH 2/2] usb: chipidea: imx: Add system suspend/resume API
Chen Peter-B29397
B29397 at freescale.com
Fri Jan 18 07:12:46 EST 2013
>
> On Fri, Jan 18, 2013 at 10:50:28AM +0800, Peter Chen wrote:
> > +#ifdef CONFIG_PM
> > +static int ci13xxx_imx_suspend(struct device *dev)
> > +{
> > + struct ci13xxx_imx_data *data =
> > + platform_get_drvdata(to_platform_device(dev));
>
> Is there a reason not to use dev_get_drvdata() here? Hint:
>
It is my careless, I will change. Thanks.
> #define to_platform_device(x) container_of((x), struct platform_device,
> dev)
>
> static inline void *platform_get_drvdata(const struct platform_device
> *pdev)
> {
> return dev_get_drvdata(&pdev->dev);
> }
>
> So, you're going from a dev => platform device => the same dev again.
>
> It's perfectly valid to use dev_get_drvdata() here because we're not
> going
> to separate these two (it makes absolutely no sense to.)
More information about the linux-arm-kernel
mailing list