2022-09-18 23:40:43

by Sean Anderson

[permalink] [raw]
Subject: [PATCH net-next 03/13] sunhme: forward the error code from pci_enable_device()

From: Rolf Eike Beer <[email protected]>

This already returns a proper error value, so pass it to the caller.

Signed-off-by: Rolf Eike Beer <[email protected]>
Signed-off-by: Sean Anderson <[email protected]>
---

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

diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
index 7340d0f2ef93..1fc16801f520 100644
--- a/drivers/net/ethernet/sun/sunhme.c
+++ b/drivers/net/ethernet/sun/sunhme.c
@@ -2940,11 +2940,12 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,
strcpy(prom_name, "SUNW,hme");
#endif

- err = -ENODEV;
+ err = pci_enable_device(pdev);

- if (pci_enable_device(pdev))
+ if (err)
goto err_out;
pci_set_master(pdev);
+ err = -ENODEV;

if (!strcmp(prom_name, "SUNW,qfe") || !strcmp(prom_name, "qfe")) {
qp = quattro_pci_find(pdev);
--
2.37.1


2022-09-20 20:00:03

by Jakub Kicinski

[permalink] [raw]
Subject: Re: [PATCH net-next 03/13] sunhme: forward the error code from pci_enable_device()

On Sun, 18 Sep 2022 19:26:16 -0400 Sean Anderson wrote:
> + err = pci_enable_device(pdev);
>
> - if (pci_enable_device(pdev))
> + if (err)

No empty lines between call and retval check