[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2f3bb6ce-50aa-40d9-959f-10c8193acaba@denx.de>
Date: Thu, 3 Oct 2024 20:31:29 +0200
From: Marek Vasut <marex@...x.de>
To: Alexis Lothoré <alexis.lothore@...tlin.com>,
linux-wireless@...r.kernel.org
Cc: "David S. Miller" <davem@...emloft.net>,
Adham Abozaeid <adham.abozaeid@...rochip.com>,
Ajay Singh <ajay.kathat@...rochip.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
Subject: Re: [PATCH v7 2/7] wifi: wilc1000: Clean up usage of
wilc_get_chipid()
On 10/3/24 7:33 PM, Alexis Lothoré wrote:
> On 10/3/24 13:14, Marek Vasut wrote:
>> Reduce the use of wilc_get_chipid(), use cached chip ID wherever
>> possible. Remove duplicated partial chip ID read implementations
>> from the driver. Update wilc_get_chipid() to always read the chip
>> ID out of the hardware and update the cached chip ID, and make it
>> return a proper return value instead of a chipid. Call wilc_get_chipid()
>> early to make the cached chip ID available to various sites using
>> is_wilc1000() to access the cached chip ID.
>>
>> Reviewed-by: Alexis Lothoré <alexis.lothore@...tlin.com>
>> Signed-off-by: Marek Vasut <marex@...x.de>
>
> [...]
>
>> +int wilc_get_chipid(struct wilc *wilc)
>> +{
>> + u32 chipid = 0;
>> + u32 rfrevid = 0;
>> +
>> + if (wilc->chipid == 0) {
>> + wilc->hif_func->hif_read_reg(wilc, WILC_CHIPID, &chipid);
>> + wilc->hif_func->hif_read_reg(wilc, WILC_RF_REVISION_ID,
>> + &rfrevid);
>> + if (!is_wilc1000(chipid)) {
>> + wilc->chipid = 0;
>> + return -EINVAL;
>> + }
>> + if (chipid == WILC_1000_BASE_ID_2A) { /* 0x1002A0 */
>> + if (rfrevid != 0x1)
>> + chipid = WILC_1000_BASE_ID_2A_REV1;
>> + } else if (chipid == WILC_1000_BASE_ID_2B) { /* 0x1002B0 */
>> + if (rfrevid == 0x4)
>> + chipid = WILC_1000_BASE_ID_2B_REV1;
>> + else if (rfrevid != 0x3)
>> + chipid = WILC_1000_BASE_ID_2B_REV2;
>> + }
>> +
>> + wilc->chipid = chipid;
>> + }
>> +
>> + return 0;
>> +}
>
> My bad for not having spotted it in v6, but you are still missing an
> EXPORT_SYMBOL_GPL(wilc_get_chipid) here, making the build fail if wilc support
> is built as module:
>
> ERROR: modpost: "wilc_get_chipid"
> [drivers/net/wireless/microchip/wilc1000/wilc1000-sdio.ko] undefined!
> ERROR: modpost: "wilc_get_chipid"
> [drivers/net/wireless/microchip/wilc1000/wilc1000-spi.ko] undefined!
> make[2]: *** [scripts/Makefile.modpost:145: Module.symvers] Error 1
> make[1]: *** [/home/alexis/src/microchip/linux/Makefile:1878: modpost] Error 2
> make: *** [Makefile:224: __sub-make] Error 2
Fixed in V8, thanks.
Before I send V8, can you have a look at the last two patches in this
series? They need some RB/TB.
Thanks !
Powered by blists - more mailing lists