[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5e972d13-357c-41a1-ab5f-95b898ea154b@denx.de>
Date: Sat, 24 Aug 2024 23:18:52 +0200
From: Marek Vasut <marex@...x.de>
To: Simon Horman <horms@...nel.org>
Cc: linux-wireless@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Adham Abozaeid <adham.abozaeid@...rochip.com>,
Ajay Singh <ajay.kathat@...rochip.com>,
Alexis Lothoré <alexis.lothore@...tlin.com>,
Claudiu Beznea <claudiu.beznea@...on.dev>, Conor Dooley
<conor+dt@...nel.org>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Kalle Valo <kvalo@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Rob Herring <robh@...nel.org>, devicetree@...r.kernel.org,
netdev@...r.kernel.org, Dan Carpenter <dan.carpenter@...aro.org>
Subject: Re: [PATCH v2 2/4] wifi: wilc1000: Fold wilc_get_chipid() into wlan.c
On 8/24/24 2:44 PM, Simon Horman wrote:
> + Dan
>
> On Fri, Aug 23, 2024 at 10:38:59PM +0200, Marek Vasut wrote:
>> On 8/23/24 7:46 PM, Simon Horman wrote:
>>> 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@...x.de>
>>>
>>> ...
>>>
>>>> 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?
>>
>> It should, will fix in V3, thanks.
>>
>>> ret = -EINVAL;
>>> goto fail;
>>>
>>> Flagged by Smatch.
>>
>> What's the trick here ?
>
> Smatch is here. I don't think there is much of a trick other than running it :)
>
> https://github.com/error27/smatch
Thanks !
Powered by blists - more mailing lists