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:

#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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to