diff mbox series

[v1] PCI: Add more information when devm_request_mem_region() goes wrong

Message ID 20200711071927.3064-1-zhengdejin5@gmail.com
State New
Delegated to: Lorenzo Pieralisi
Headers show
Series [v1] PCI: Add more information when devm_request_mem_region() goes wrong | expand

Commit Message

Dejin Zheng July 11, 2020, 7:19 a.m. UTC
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@gmail.com>
---
 drivers/pci/pci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

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);
 	}