summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuotao Fu <l.fu@pengutronix.de>2009-07-20 10:29:59 +0200
committerLuotao Fu <l.fu@pengutronix.de>2009-07-20 10:29:59 +0200
commit16f62c9b7d91c52be9d72c74e9585c56e271641c (patch)
treef5665fd83185faa3e3f00022f71805d04de888e5
parentc8d4a4f40d77fce32faf4eb239e7f6496d47ced6 (diff)
downloadlinux-2.6-16f62c9b7d91c52be9d72c74e9585c56e271641c.tar.gz
linux-2.6-16f62c9b7d91c52be9d72c74e9585c56e271641c.tar.xz
mc13783: fix drv_data usage
mc13783 core uses the drv_data member to store the pointer to mc13783 struct in every platformdevice, which it registers for the subdevices. However the devcises resets the pointer in their platform device to store the pointer to its own priv struct as soon as it is loaded. This leads to the device driver leaves invalid addess in its platform device once its unloaded. This way the drivers can only loaded once since it'll need the pointer to mc13783 on loading. We now use platform_data to store this pointer instead and let the drivers use drv_data for their own purpose. Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
-rw-r--r--drivers/input/touchscreen/mc13783_ts.c2
-rw-r--r--drivers/mfd/mc13783-core.c2
-rw-r--r--sound/arm/mc13783.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/drivers/input/touchscreen/mc13783_ts.c b/drivers/input/touchscreen/mc13783_ts.c
index 2a04958fab1..e25bd3f63de 100644
--- a/drivers/input/touchscreen/mc13783_ts.c
+++ b/drivers/input/touchscreen/mc13783_ts.c
@@ -119,7 +119,7 @@ static int __init mc13783_ts_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;
- priv->mc13783 = platform_get_drvdata(pdev);
+ priv->mc13783 = pdev->dev.platform_data;
idev = input_allocate_device();
if (!idev) {
diff --git a/drivers/mfd/mc13783-core.c b/drivers/mfd/mc13783-core.c
index 62c3c9a8c23..54e646b4abe 100644
--- a/drivers/mfd/mc13783-core.c
+++ b/drivers/mfd/mc13783-core.c
@@ -230,7 +230,7 @@ static void mc13783_client_dev_register(struct mc13783 *mc13783,
}
(*pdev)->dev.parent = mc13783->dev;
- platform_set_drvdata(*pdev, mc13783);
+ (*pdev)->dev.platform_data = mc13783;
ret = platform_device_add(*pdev);
if (ret != 0) {
dev_err(mc13783->dev, "Failed to register %s: %d\n", name, ret);
diff --git a/sound/arm/mc13783.c b/sound/arm/mc13783.c
index a0adce8168c..be7b065d865 100644
--- a/sound/arm/mc13783.c
+++ b/sound/arm/mc13783.c
@@ -537,7 +537,7 @@ static int mc13783_codec_probe(struct platform_device *pdev)
if (mc13783)
return -EBUSY;
- mc13783 = platform_get_drvdata(pdev);
+ mc13783 = pdev->dev.platform_data;
return 0;
}