[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20200711071927.3064-1-zhengdejin5@gmail.com>
Date: Sat, 11 Jul 2020 15:19:27 +0800
From: Dejin Zheng <zhengdejin5@...il.com>
To: bhelgaas@...gle.com, lorenzo.pieralisi@....com,
linux-pci@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, Dejin Zheng <zhengdejin5@...il.com>
Subject: [PATCH v1] PCI: Add more information when devm_request_mem_region() goes wrong
Add more information, the name of the resource will be printed when the
request memory region or remapping of configuration space fails in the
devm_request_mem_region() function.
Signed-off-by: Dejin Zheng <zhengdejin5@...il.com>
---
drivers/pci/pci.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index ce096272f52b..81c1045a3fa8 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -4153,13 +4153,15 @@ void __iomem *devm_pci_remap_cfg_resource(struct device *dev,
name = res->name ?: dev_name(dev);
if (!devm_request_mem_region(dev, res->start, size, name)) {
- dev_err(dev, "can't request region for resource %pR\n", res);
+ dev_err(dev, "can't request region for %s's resource %pR\n",
+ name, res);
return IOMEM_ERR_PTR(-EBUSY);
}
dest_ptr = devm_pci_remap_cfgspace(dev, res->start, size);
if (!dest_ptr) {
- dev_err(dev, "ioremap failed for resource %pR\n", res);
+ dev_err(dev, "ioremap failed for %s's resource %pR\n",
+ name, res);
devm_release_mem_region(dev, res->start, size);
dest_ptr = IOMEM_ERR_PTR(-ENOMEM);
}
--
2.25.0
Powered by blists - more mailing lists