Skip to contentSkip to conversation

net: sunhme: Fix region request

PATCH Applied Sean Anderson 3 participants 3 messages Feb 22, 2023 – Feb 24, 2023

Subsystems (3)
lore
Share & tools
lore

Sean Anderson

author maintainer
#0 lore raw

PATCH 1/1 net: sunhme: Fix region request

devm_request_region is for I/O regions. Use devm_request_mem_region instead. This fixes the driver failing to probe since 99df45c9e0a4 ("sunhme: fix an IS_ERR() vs NULL check in probe"), which checked the result.

Fixes 914d9b2711dd ("sunhme: switch to devres")

---

 drivers/net/ethernet/sun/sunhme.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/sun/sunhme.c +4 -2
index 1c16548415cd..b0c7ab74a82e 100644
@@ -2894,8 +2894,10 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,
 		goto err_out_clear_quattro;
 	}
 
-	hpreg_res = devm_request_region(&pdev->dev, pci_resource_start(pdev, 0),
-					pci_resource_len(pdev, 0), DRV_NAME);
+	hpreg_res = devm_request_mem_region(&pdev->dev,
+					    pci_resource_start(pdev, 0),
+					    pci_resource_len(pdev, 0),
+					    DRV_NAME);
 	if (!hpreg_res) {
 		err = -EBUSY;
 		dev_err(&pdev->dev, "Cannot obtain PCI resources, aborting.\n");
Signature · 1 line
2.37.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Sean Anderson

devm_request_region is for I/O regions. Use devm_request_mem_region instead. This fixes the driver failing to probe since 99df45c9e0a4 ("sunhme: fix an IS_ERR() vs NULL check in probe"), which checked the result.

Fixes 914d9b2711dd ("sunhme: switch to devres")

---

Looks OK to me.

Quoted 23 lines
 drivers/net/ethernet/sun/sunhme.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/sun/sunhme.c +4 -3
index 1c16548415cd..b0c7ab74a82e 100644
@@ -2894,8 +2894,10 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,
                goto err_out_clear_quattro;
        }
 
-       hpreg_res = devm_request_region(&pdev->dev, pci_resource_start(pdev, 0),
-                                       pci_resource_len(pdev, 0), DRV_NAME);
+       hpreg_res = devm_request_mem_region(&pdev->dev,
+                                           pci_resource_start(pdev, 0),
+                                           pci_resource_len(pdev, 0),
+                                           DRV_NAME);
        if (!hpreg_res) {
                err = -EBUSY;
                dev_err(&pdev->dev, "Cannot obtain PCI resources, aborting.\n");
--

2.37.1

maintainer Applied
#2 lore raw
In reply to Sean Anderson
Quoted 7 lines · On Wed, 22 Feb 2023 15:42:41 -0500 Sean Anderson wrote:

devm_request_region is for I/O regions. Use devm_request_mem_region instead. This fixes the driver failing to probe since 99df45c9e0a4 ("sunhme: fix an IS_ERR() vs NULL check in probe"), which checked the result.

Fixes 914d9b2711dd ("sunhme: switch to devres")

Applied, thanks!