aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-06-10 11:38:29 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-06-10 11:38:29 -0400
commit0e6c861f73ec42ab5c89fda9892f2173c7aaf6cf (patch)
treeb24c500276a9dd4058387b09a6f36402f61b2fa2
parent5da7f70997f772d7605c11d9e00018ffac463d92 (diff)
Revert "base/platform: Only insert MEM and IO resources"
This reverts commit 36d4b29260753ad78b1ce4363145332c02519adc as it breaks working machines. Cc: Rob Herring <robh@kernel.org> Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/base/platform.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 46a56f694cec..063f0ab15259 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -341,23 +341,19 @@ int platform_device_add(struct platform_device *pdev)
341 341
342 for (i = 0; i < pdev->num_resources; i++) { 342 for (i = 0; i < pdev->num_resources; i++) {
343 struct resource *p, *r = &pdev->resource[i]; 343 struct resource *p, *r = &pdev->resource[i];
344 unsigned long type = resource_type(r);
345 344
346 if (r->name == NULL) 345 if (r->name == NULL)
347 r->name = dev_name(&pdev->dev); 346 r->name = dev_name(&pdev->dev);
348 347
349 if (!(type == IORESOURCE_MEM || type == IORESOURCE_IO))
350 continue;
351
352 p = r->parent; 348 p = r->parent;
353 if (!p) { 349 if (!p) {
354 if (type == IORESOURCE_MEM) 350 if (resource_type(r) == IORESOURCE_MEM)
355 p = &iomem_resource; 351 p = &iomem_resource;
356 else if (type == IORESOURCE_IO) 352 else if (resource_type(r) == IORESOURCE_IO)
357 p = &ioport_resource; 353 p = &ioport_resource;
358 } 354 }
359 355
360 if (insert_resource(p, r)) { 356 if (p && insert_resource(p, r)) {
361 dev_err(&pdev->dev, "failed to claim resource %d\n", i); 357 dev_err(&pdev->dev, "failed to claim resource %d\n", i);
362 ret = -EBUSY; 358 ret = -EBUSY;
363 goto failed; 359 goto failed;