ACPI: AMBA: Fix resource name in /proc/iomem
authorLiguang Zhang <zhangliguang@linux.alibaba.com>
Tue, 29 Jun 2021 11:27:48 +0000 (19:27 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 30 Jun 2021 18:01:10 +0000 (20:01 +0200)
In function amba_handler_attach(), dev->res.name is initialized by
amba_device_alloc. But when address_found is false, dev->res.name is
assigned to null value, which leads to wrong resource name display in
/proc/iomem, "<BAD>" is seen for those resources.

Signed-off-by: Liguang Zhang <zhangliguang@linux.alibaba.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpi_amba.c

index 49b781a..ab8a4e0 100644 (file)
@@ -76,6 +76,7 @@ static int amba_handler_attach(struct acpi_device *adev,
                case IORESOURCE_MEM:
                        if (!address_found) {
                                dev->res = *rentry->res;
+                               dev->res.name = dev_name(&dev->dev);
                                address_found = true;
                        }
                        break;