aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/platform.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/platform.c')
-rw-r--r--drivers/base/platform.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index ec993aa6a2ca..c5ac81d22303 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -217,6 +217,7 @@ int platform_device_add_data(struct platform_device *pdev, const void *data,
217 if (d) { 217 if (d) {
218 memcpy(d, data, size); 218 memcpy(d, data, size);
219 pdev->dev.platform_data = d; 219 pdev->dev.platform_data = d;
220 pdev->platform_data = d;
220 } 221 }
221 return d ? 0 : -ENOMEM; 222 return d ? 0 : -ENOMEM;
222} 223}
@@ -246,6 +247,8 @@ int platform_device_add(struct platform_device *pdev)
246 else 247 else
247 dev_set_name(&pdev->dev, pdev->name); 248 dev_set_name(&pdev->dev, pdev->name);
248 249
250 pdev->platform_data = pdev->dev.platform_data;
251
249 for (i = 0; i < pdev->num_resources; i++) { 252 for (i = 0; i < pdev->num_resources; i++) {
250 struct resource *p, *r = &pdev->resource[i]; 253 struct resource *p, *r = &pdev->resource[i];
251 254