Re: [PATCH v2 2/4] wifi: wilc1000: Fold wilc_get_chipid() into wlan.c

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

 



On Fri, Aug 23, 2024 at 06:08:57PM +0200, Marek Vasut wrote:
> Do not use wilc_get_chipid() outside of wlan.c . Instead, call
> wilc_get_chipid() right after the SDIO/SPI interface has been
> initialized to cache the device chipid, and then use the cached
> chipid throughout the driver. Make wilc_get_chipid() static and
> remove its prototype from wlan.h .
> 
> Signed-off-by: Marek Vasut <marex@xxxxxxx>

...

> diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c

...

> @@ -1535,9 +1537,18 @@ int wilc_wlan_init(struct net_device *dev)
>  	if (!wilc->hif_func->hif_is_init(wilc)) {
>  		acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY);
>  		ret = wilc->hif_func->hif_init(wilc, false);
> +		if (!ret)
> +			chipid = wilc_get_chipid(wilc);
>  		release_bus(wilc, WILC_BUS_RELEASE_ONLY);
>  		if (ret)
>  			goto fail;
> +
> +		if (!is_wilc1000(chipid)) {
> +			netdev_err(dev, "Unsupported chipid: %x\n", chipid);
> +			return -EINVAL;

Hi Marek,

Should this unwind as is the case elsewhere in this function?

			ret = -EINVAL;
			goto fail;

Flagged by Smatch.

> +		}
> +
> +		netdev_dbg(dev, "chipid (%08x)\n", chipid);
>  	}
>  
>  	if (!wilc->vmm_table)

...




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux