* [PATCH] i2c: use platform_{get,set}_drvdata()
@ 2013-05-23 10:22 Jingoo Han
2013-06-11 19:45 ` Wolfram Sang
0 siblings, 1 reply; 2+ messages in thread
From: Jingoo Han @ 2013-05-23 10:22 UTC (permalink / raw)
To: 'Wolfram Sang'
Cc: 'Wolfram Sang', linux-i2c-u79uwXL29TY76Z2rM5mHXA,
'Jingoo Han', 'Jochen Friedrich'
Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.
Signed-off-by: Jingoo Han <jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
---
drivers/i2c/busses/i2c-cpm.c | 4 ++--
drivers/i2c/busses/i2c-ibm_iic.c | 4 ++--
drivers/i2c/busses/i2c-mpc.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
index 3823623..eccf5c2 100644
--- a/drivers/i2c/busses/i2c-cpm.c
+++ b/drivers/i2c/busses/i2c-cpm.c
@@ -646,7 +646,7 @@ static int cpm_i2c_probe(struct platform_device *ofdev)
cpm->ofdev = ofdev;
- dev_set_drvdata(&ofdev->dev, cpm);
+ platform_set_drvdata(ofdev, cpm);
cpm->adap = cpm_ops;
i2c_set_adapdata(&cpm->adap, cpm);
@@ -689,7 +689,7 @@ out_free:
static int cpm_i2c_remove(struct platform_device *ofdev)
{
- struct cpm_i2c *cpm = dev_get_drvdata(&ofdev->dev);
+ struct cpm_i2c *cpm = platform_get_drvdata(ofdev);
i2c_del_adapter(&cpm->adap);
diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
index 405a2e2..973f516 100644
--- a/drivers/i2c/busses/i2c-ibm_iic.c
+++ b/drivers/i2c/busses/i2c-ibm_iic.c
@@ -705,7 +705,7 @@ static int iic_probe(struct platform_device *ofdev)
return -ENOMEM;
}
- dev_set_drvdata(&ofdev->dev, dev);
+ platform_set_drvdata(ofdev, dev);
dev->vaddr = of_iomap(np, 0);
if (dev->vaddr == NULL) {
@@ -782,7 +782,7 @@ error_cleanup:
*/
static int iic_remove(struct platform_device *ofdev)
{
- struct ibm_iic_private *dev = dev_get_drvdata(&ofdev->dev);
+ struct ibm_iic_private *dev = platform_get_drvdata(ofdev);
i2c_del_adapter(&dev->adap);
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index 5e705ee..7607dc0 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -679,7 +679,7 @@ static int fsl_i2c_probe(struct platform_device *op)
}
dev_info(i2c->dev, "timeout %u us\n", mpc_ops.timeout * 1000000 / HZ);
- dev_set_drvdata(&op->dev, i2c);
+ platform_set_drvdata(op, i2c);
i2c->adap = mpc_ops;
i2c_set_adapdata(&i2c->adap, i2c);
@@ -707,7 +707,7 @@ static int fsl_i2c_probe(struct platform_device *op)
static int fsl_i2c_remove(struct platform_device *op)
{
- struct mpc_i2c *i2c = dev_get_drvdata(&op->dev);
+ struct mpc_i2c *i2c = platform_get_drvdata(op);
i2c_del_adapter(&i2c->adap);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] i2c: use platform_{get,set}_drvdata()
2013-05-23 10:22 [PATCH] i2c: use platform_{get,set}_drvdata() Jingoo Han
@ 2013-06-11 19:45 ` Wolfram Sang
0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2013-06-11 19:45 UTC (permalink / raw)
To: Jingoo Han
Cc: 'Wolfram Sang', linux-i2c-u79uwXL29TY76Z2rM5mHXA,
'Jochen Friedrich'
[-- Attachment #1: Type: text/plain, Size: 385 bytes --]
On Thu, May 23, 2013 at 07:22:40PM +0900, Jingoo Han wrote:
> Use the wrapper functions for getting and setting the driver data using
> platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
> so we can directly pass a struct platform_device.
>
> Signed-off-by: Jingoo Han <jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Applied to for-next, thanks!
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-06-11 19:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-23 10:22 [PATCH] i2c: use platform_{get,set}_drvdata() Jingoo Han
2013-06-11 19:45 ` Wolfram Sang
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).