RE: [PATCH 2/2] usb: chipidea: imx: Add system suspend/resume API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 
> 
> 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.)


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux