From: balbi@ti.com (Felipe Balbi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH REBASE 1/6] i2c: omap: no need to access platform_device
Date: Fri, 14 Dec 2012 18:34:04 +0200 [thread overview]
Message-ID: <1355502849-9289-2-git-send-email-balbi@ti.com> (raw)
In-Reply-To: <1355502849-9289-1-git-send-email-balbi@ti.com>
PM callbacks pass our device pointer as argument
and we don't need to access the platform_device
just to dereference that down to dev->drvdata.
instead, just use dev_get_drvdata() directly.
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
drivers/i2c/busses/i2c-omap.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 7a62acb..9a9cf7c 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -1289,8 +1289,7 @@ static int __devexit omap_i2c_remove(struct platform_device *pdev)
#ifdef CONFIG_PM_RUNTIME
static int omap_i2c_runtime_suspend(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct omap_i2c_dev *_dev = platform_get_drvdata(pdev);
+ struct omap_i2c_dev *_dev = dev_get_drvdata(dev);
_dev->iestate = omap_i2c_read_reg(_dev, OMAP_I2C_IE_REG);
@@ -1310,8 +1309,7 @@ static int omap_i2c_runtime_suspend(struct device *dev)
static int omap_i2c_runtime_resume(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct omap_i2c_dev *_dev = platform_get_drvdata(pdev);
+ struct omap_i2c_dev *_dev = dev_get_drvdata(dev);
if (!_dev->regs)
return 0;
--
1.8.1.rc1.5.g7e0651a
next prev parent reply other threads:[~2012-12-14 16:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-14 16:34 [PATCH REBASE 0/6] i2c: omap: misc changes Felipe Balbi
2012-12-14 16:34 ` Felipe Balbi [this message]
2012-12-14 16:34 ` [PATCH REBASE 2/6] i2c: omap: also complete() when stat becomes zero Felipe Balbi
2012-12-14 16:34 ` [PATCH REBASE 3/6] i2c: omap: improve 'rev' a little bit Felipe Balbi
2012-12-14 16:34 ` [PATCH REBASE 4/6] i2c: omap: in case of VERSION_2 read IRQSTATUS_RAW but write to IRQSTATUS Felipe Balbi
2012-12-14 16:34 ` [PATCH REBASE 5/6] i2c: omap: wait for transfer completion before sending STP bit Felipe Balbi
2012-12-14 16:34 ` [PATCH REBASE 6/6] i2c: omap: get rid of b_hw flag Felipe Balbi
2013-01-14 19:16 ` [PATCH REBASE 0/6] i2c: omap: misc changes Felipe Balbi
2013-01-23 9:58 ` Wolfram Sang
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=1355502849-9289-2-git-send-email-balbi@ti.com \
--to=balbi@ti.com \
--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