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 8/27/24 17:34, Marek Vasut wrote:
> On 8/27/24 9:51 AM, Alexis Lothoré wrote:
> 
> Hi,
> 
>>> +static u32 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);
>> If we search for WILC_CHIPID in the whole driver, there are still two places
>> manually reading this register. Shouldn't those places also benefit from
>> wilc_get_chipid ?
> 
> Both the one in wilc_wlan_start() and wilc_validate_chipid() look more like some
> sort of communication check attempt, rather than reading out the chipid for any
> sort of actual chip identification purpose. I could simply remove those ?

Agree about the purpose of this reading in wilc_wlan_start and wilc_validate_chipid.
And about removing those: I would say why not. wilc_validate_chipid has proven
to be quite useful to diagnose some early communication failure, but I guess
there are enough communications attempts around
(wilc_spi_configure_bus_protocol, wilc_load_mac_from_nv) to still validate than
we are able to communicate with the chip at probe time.
> 
>>> +        wilc->hif_func->hif_read_reg(wilc, WILC_RF_REVISION_ID,
>>> +                         &rfrevid);
>>> +        if (!is_wilc1000(chipid)) {
>>> +            wilc->chipid = 0;
>>
>> While at it, since you have trimmed the update parameter, it would be nice to
>> also fix this return value (ie make wilc_getchipid() not return 0 but a real
>> error code if we can not read the chip id.
> 
> Fixed in V3, thanks .

Great, thanks

Alexis

-- 
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com





[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