diff mbox series

[net] net: sunhme: Fix region request

Message ID 20230222204242.2658247-1-seanga2@gmail.com (mailing list archive)
State Accepted
Delegated to: Netdev Maintainers
Headers show
Series [net] net: sunhme: Fix region request | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 12 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Sean Anderson Feb. 22, 2023, 8:42 p.m. UTC
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")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
---

 drivers/net/ethernet/sun/sunhme.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Pavan Chebbi Feb. 23, 2023, 8:05 a.m. UTC | #1
On Thu, Feb 23, 2023 at 2:12 AM Sean Anderson <seanga2@gmail.com> 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")
> Signed-off-by: Sean Anderson <seanga2@gmail.com>
> ---
>
Looks OK to me.
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>


>  drivers/net/ethernet/sun/sunhme.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
> index 1c16548415cd..b0c7ab74a82e 100644
> --- a/drivers/net/ethernet/sun/sunhme.c
> +++ b/drivers/net/ethernet/sun/sunhme.c
> @@ -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
>
Jakub Kicinski Feb. 24, 2023, 3:03 a.m. UTC | #2
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")
> Signed-off-by: Sean Anderson <seanga2@gmail.com>

Applied, thanks!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
index 1c16548415cd..b0c7ab74a82e 100644
--- a/drivers/net/ethernet/sun/sunhme.c
+++ b/drivers/net/ethernet/sun/sunhme.c
@@ -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");