Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1351821 > unrolled thread

RE: [PATCH 2/2] bnx2x:Fix error handling for functions in bnx2x_link.c

Started byAriel Elior <Ariel.Elior@qlogic.com>
First post2016-03-07 18:30 +0100
Last post2016-03-07 18:30 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  RE: [PATCH 2/2] bnx2x:Fix error handling for functions in  bnx2x_link.c Ariel Elior <Ariel.Elior@qlogic.com> - 2016-03-07 18:30 +0100

#1351821 — RE: [PATCH 2/2] bnx2x:Fix error handling for functions in bnx2x_link.c

FromAriel Elior <Ariel.Elior@qlogic.com>
Date2016-03-07 18:30 +0100
SubjectRE: [PATCH 2/2] bnx2x:Fix error handling for functions in bnx2x_link.c
Message-ID<ra78L-5Qh-21@gated-at.bofh.it>
> -----Original Message-----
> From: Nicholas Krause [mailto:xerofoify@gmail.com]
> Sent: Monday, March 07, 2016 4:12 AM
> To: Ariel Elior <Ariel.Elior@qlogic.com>
> Cc: netdev <netdev@vger.kernel.org>; linux-kernel <linux-kernel@vger.kernel.org>
> Subject: [PATCH 2/2] bnx2x:Fix error handling for functions in bnx2x_link.c
> 
> This fixes various functions that call the function
> bnx2x_84833_get_reset_gpios to properly check if this
> function has returned a error code and if so return
> immediately with the error code to signal these function's
> 
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
>  drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | 23 ++++++++++++++++++++---
>  1 file changed, 20 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
> b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
> index a0b03c2..b0646d9 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
> @@ -10079,6 +10079,7 @@ static int bnx2x_84833_hw_reset_phy(struct bnx2x_phy
> *phy,
>  {
>  	struct bnx2x *bp = params->bp;
>  	u8 reset_gpios;
> +	int rc;
>  	u32 other_shmem_base_addr = REG_RD(bp, params->shmem2_base +
>  				offsetof(struct shmem2_region,
>  				other_shmem_base_addr));
> @@ -10099,7 +10100,12 @@ static int bnx2x_84833_hw_reset_phy(struct bnx2x_phy
> *phy,
>  	reset_gpios = bnx2x_84833_get_reset_gpios(bp, shmem_base_path,
>  						  params->chip_id);
> 
> -	bnx2x_set_mult_gpio(bp, reset_gpios,
> MISC_REGISTERS_GPIO_OUTPUT_LOW);
> +	rc = bnx2x_set_mult_gpio(bp, reset_gpios,
> MISC_REGISTERS_GPIO_OUTPUT_LOW);
> +	if (rc) {
> +		DP(NETIF_MSG_LINK, "84833 hw reset on pin values 0x%x\n failed ",
> +		   reset_gpios);
> +		return rc;
> +	}
>  	udelay(10);
>  	DP(NETIF_MSG_LINK, "84833 hw reset on pin values 0x%x\n",
>  		reset_gpios);
> @@ -13242,10 +13248,21 @@ static int bnx2x_84833_common_init_phy(struct
> bnx2x *bp,
>  						u32 chip_id)
>  {
>  	u8 reset_gpios;
> +	int ret;
>  	reset_gpios = bnx2x_84833_get_reset_gpios(bp, shmem_base_path, chip_id);
> -	bnx2x_set_mult_gpio(bp, reset_gpios,
> MISC_REGISTERS_GPIO_OUTPUT_LOW);
> +	ret = bnx2x_set_mult_gpio(bp, reset_gpios,
> MISC_REGISTERS_GPIO_OUTPUT_LOW);
> +	if (ret) {
> +		DP(NETIF_MSG_LINK, "84833 reset pulse on pin values 0x%x\n",
> +		   reset_gpios);
> +		return ret;
> +	}
>  	udelay(10);
> -	bnx2x_set_mult_gpio(bp, reset_gpios,
> MISC_REGISTERS_GPIO_OUTPUT_HIGH);
> +	ret = bnx2x_set_mult_gpio(bp, reset_gpios,
> MISC_REGISTERS_GPIO_OUTPUT_HIGH);
> +	if (ret) {
> +		DP(NETIF_MSG_LINK, "84833 reset pulse on pin values 0x%x\n",
> +		   reset_gpios);
> +		return ret;
> +	}
>  	DP(NETIF_MSG_LINK, "84833 reset pulse on pin values 0x%x\n",
>  		reset_gpios);
>  	return 0;
> --
> 2.1.4
Thanks Nicholas.
Acked-by: Ariel Elior <ariel.elior@qlogic.com>

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web