From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] usb: chipidea: imx: Add system suspend/resume API
Date: Fri, 18 Jan 2013 10:59:02 +0000 [thread overview]
Message-ID: <20130118105901.GC23505@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1358477428-2605-2-git-send-email-peter.chen@freescale.com>
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.)
next prev parent reply other threads:[~2013-01-18 10:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-18 2:50 [PATCH 1/2] usb: mxs-phy: add set_suspend API Peter Chen
2013-01-18 2:50 ` [PATCH 2/2] usb: chipidea: imx: Add system suspend/resume API Peter Chen
2013-01-18 3:35 ` Shawn Guo
2013-01-18 10:59 ` Russell King - ARM Linux [this message]
2013-01-18 12:12 ` Chen Peter-B29397
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130118105901.GC23505@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).