diff mbox series

[3/3] sunhme: forward the error code from pci_enable_device()

Message ID 8022143.T7Z3S40VBb@eto.sf-tec.de (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [1/3] sunhme: remove unused tx_dump_ring() | expand

Checks

Context Check Description
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter warning Series does not have a cover letter
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 warning 3 maintainers not CCed: davem@davemloft.net kuba@kernel.org christophe.jaillet@wanadoo.fr
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/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Rolf Eike Beer Feb. 3, 2022, 4:23 p.m. UTC
This already returns a proper error value, so pass it to the caller.

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
---
 drivers/net/ethernet/sun/sunhme.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Sean Anderson July 27, 2022, 3:48 a.m. UTC | #1
On 2/3/22 11:23 AM, Rolf Eike Beer wrote:
> This already returns a proper error value, so pass it to the caller.
> 
> Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
> ---
>   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 43834339bb43..980a936ce8d1 100644
> --- a/drivers/net/ethernet/sun/sunhme.c
> +++ b/drivers/net/ethernet/sun/sunhme.c
> @@ -2969,11 +2969,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);
> 

This is incrementally better, but there are several more calls like this. A follow
up converting those as well would be good.

Reviewed-by: Sean Anderson <seanga2@gmail.com>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
index 43834339bb43..980a936ce8d1 100644
--- a/drivers/net/ethernet/sun/sunhme.c
+++ b/drivers/net/ethernet/sun/sunhme.c
@@ -2969,11 +2969,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);