Skip to content

Commit

Permalink
Revert "base/platform: Only insert MEM and IO resources"
Browse files Browse the repository at this point in the history
This reverts commit 36d4b29 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>
  • Loading branch information
Greg Kroah-Hartman committed Jun 10, 2015
1 parent 5da7f70 commit 0e6c861
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions drivers/base/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,23 +341,19 @@ int platform_device_add(struct platform_device *pdev)

for (i = 0; i < pdev->num_resources; i++) {
struct resource *p, *r = &pdev->resource[i];
unsigned long type = resource_type(r);

if (r->name == NULL)
r->name = dev_name(&pdev->dev);

if (!(type == IORESOURCE_MEM || type == IORESOURCE_IO))
continue;

p = r->parent;
if (!p) {
if (type == IORESOURCE_MEM)
if (resource_type(r) == IORESOURCE_MEM)
p = &iomem_resource;
else if (type == IORESOURCE_IO)
else if (resource_type(r) == IORESOURCE_IO)
p = &ioport_resource;
}

if (insert_resource(p, r)) {
if (p && insert_resource(p, r)) {
dev_err(&pdev->dev, "failed to claim resource %d\n", i);
ret = -EBUSY;
goto failed;
Expand Down

0 comments on commit 0e6c861

Please sign in to comment.