aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/base/platform.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index c5ac81d22303..d2198f64ad4e 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -247,7 +247,20 @@ int platform_device_add(struct platform_device *pdev)
247 else 247 else
248 dev_set_name(&pdev->dev, pdev->name); 248 dev_set_name(&pdev->dev, pdev->name);
249 249
250 pdev->platform_data = pdev->dev.platform_data; 250 /* We will remove platform_data field from struct device
251 * if all platform devices pass its platform specific data
252 * from platform_device. The conversion is going to be a
253 * long time, so we allow the two cases coexist to make
254 * this kind of fix more easily*/
255 if (pdev->platform_data && pdev->dev.platform_data) {
256 printk(KERN_ERR
257 "%s: use which platform_data?\n",
258 dev_name(&pdev->dev));
259 } else if (pdev->platform_data) {
260 pdev->dev.platform_data = pdev->platform_data;
261 } else if (pdev->dev.platform_data) {
262 pdev->platform_data = pdev->dev.platform_data;
263 }
251 264
252 for (i = 0; i < pdev->num_resources; i++) { 265 for (i = 0; i < pdev->num_resources; i++) {
253 struct resource *p, *r = &pdev->resource[i]; 266 struct resource *p, *r = &pdev->resource[i];