lkml.org 
[lkml]   [2022]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 2/2] net: dsa: LAN9303: Add basic support for LAN9354
Date
>> -     if ((reg >> 16) != LAN9303_CHIP_ID) {
>> - dev_err(chip->dev, "expecting LAN9303 chip, but found: %X\n",
>> + if (((reg >> 16) != LAN9303_CHIP_ID) &&
>> + ((reg >> 16) != LAN9354_CHIP_ID)) {
>> + dev_err(chip->dev, "unexpected device found:
>> + LAN%4.4X\n",
>> reg >> 16);
>> return -ENODEV;
>> }
>> @@ -884,7 +889,7 @@ static int lan9303_check_device(struct lan9303 *chip)
>> if (ret)
>> dev_warn(chip->dev, "failed to disable switching %d\n",
>> ret);
>>
>> - dev_info(chip->dev, "Found LAN9303 rev. %u\n", reg & 0xffff);
>> + dev_info(chip->dev, "Found LAN%4.4X rev. %u\n", (reg >> 16), reg
>> + & 0xffff);
>>
>> ret = lan9303_detect_phy_setup(chip);
>> if (ret) {
>> diff --git a/drivers/net/dsa/lan9303_mdio.c
>> b/drivers/net/dsa/lan9303_mdio.c index bbb7032409ba..d12c55fdc811
>> 100644
>> --- a/drivers/net/dsa/lan9303_mdio.c
>> +++ b/drivers/net/dsa/lan9303_mdio.c
>> @@ -158,6 +158,7 @@ static void lan9303_mdio_shutdown(struct
>> mdio_device *mdiodev)
>>
>> static const struct of_device_id lan9303_mdio_of_match[] = {
>> { .compatible = "smsc,lan9303-mdio" },
>> + { .compatible = "microchip,lan9354-mdio" },
>
>Please validate that what you find on the board actually is what the compatible says it should be. If you don't validate it, there will be some DT blobs that have the wrong value, but probe fine. But then you cannot actually make use of the compatible string in the driver to do something different between the 9303 and the 9354 because some boards have the wrong compatible....
>
> Andrew
>

At this time, the driver is meant to support both devices equally. In the future, I will be adding content that only applies to the LAN9354. That is when I'm planning to add .data to the .compatible entries.

Jerry.

\
 
 \ /
  Last update: 2022-09-02 22:19    [W:0.054 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site