mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-10 23:29:46 +00:00
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>
This commit is contained in:
parent
5da7f70997
commit
0e6c861f73
@ -341,23 +341,19 @@ int platform_device_add(struct platform_device *pdev)
|
|||||||
|
|
||||||
for (i = 0; i < pdev->num_resources; i++) {
|
for (i = 0; i < pdev->num_resources; i++) {
|
||||||
struct resource *p, *r = &pdev->resource[i];
|
struct resource *p, *r = &pdev->resource[i];
|
||||||
unsigned long type = resource_type(r);
|
|
||||||
|
|
||||||
if (r->name == NULL)
|
if (r->name == NULL)
|
||||||
r->name = dev_name(&pdev->dev);
|
r->name = dev_name(&pdev->dev);
|
||||||
|
|
||||||
if (!(type == IORESOURCE_MEM || type == IORESOURCE_IO))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
p = r->parent;
|
p = r->parent;
|
||||||
if (!p) {
|
if (!p) {
|
||||||
if (type == IORESOURCE_MEM)
|
if (resource_type(r) == IORESOURCE_MEM)
|
||||||
p = &iomem_resource;
|
p = &iomem_resource;
|
||||||
else if (type == IORESOURCE_IO)
|
else if (resource_type(r) == IORESOURCE_IO)
|
||||||
p = &ioport_resource;
|
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);
|
dev_err(&pdev->dev, "failed to claim resource %d\n", i);
|
||||||
ret = -EBUSY;
|
ret = -EBUSY;
|
||||||
goto failed;
|
goto failed;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user