Re: [PATCH] staging: r8188eu: handle errors from ReadAdapterInfo8188EU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jul 24, 2022 at 06:14:05PM +0200, Martin Kaiser wrote:
> Update ReadAdapterInfo8188EU to return 0 for success or a negative
> error code. Don't use the infamous _SUCCESS and _FAIL defines.
> 
> Handle returned errors in rtw_usb_if1_init, this will eventually fail the
> probing of the r8188eu driver.
> 
> Suggested-by: Pavel Skripkin <paskripkin@xxxxxxxxx>
> Signed-off-by: Martin Kaiser <martin@xxxxxxxxx>
> ---
>  drivers/staging/r8188eu/hal/usb_halinit.c  | 7 ++++---
>  drivers/staging/r8188eu/include/hal_intf.h | 2 +-
>  drivers/staging/r8188eu/os_dep/usb_intf.c  | 3 ++-
>  3 files changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/hal/usb_halinit.c b/drivers/staging/r8188eu/hal/usb_halinit.c
> index 421fe7c40390..08d4b5dfd430 100644
> --- a/drivers/staging/r8188eu/hal/usb_halinit.c
> +++ b/drivers/staging/r8188eu/hal/usb_halinit.c
> @@ -922,7 +922,7 @@ static void Hal_EfuseParseMACAddr_8188EU(struct adapter *adapt, u8 *hwinfo, bool
>  	}
>  }
>  
> -void ReadAdapterInfo8188EU(struct adapter *Adapter)
> +int ReadAdapterInfo8188EU(struct adapter *Adapter)
>  {
>  	struct eeprom_priv *eeprom = &Adapter->eeprompriv;
>  	struct led_priv *ledpriv = &Adapter->ledpriv;
> @@ -933,13 +933,13 @@ void ReadAdapterInfo8188EU(struct adapter *Adapter)
>  	/* check system boot selection */
>  	res = rtw_read8(Adapter, REG_9346CR, &eeValue);
>  	if (res)
> -		return;
> +		return -1;

This is not a valid error code, please use a real -ESOMETHING instead.

thanks,

greg k-h




[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux