]> git.baikalelectronics.ru Git - kernel.git/commit
net: dp83869: Reset return variable if PHY strap is read
authorDan Murphy <dmurphy@ti.com>
Fri, 5 Jun 2020 20:51:03 +0000 (15:51 -0500)
committerDavid S. Miller <davem@davemloft.net>
Sat, 6 Jun 2020 22:53:44 +0000 (15:53 -0700)
commit49cf604678af1fc90842e78811e9e5030914ab13
tree34ccaa08e4f5a25f8b1058cf52a56acb7d6c0aa7
parentfba4b1f619ef29e3a0e041553ca62d822bd72d8e
net: dp83869: Reset return variable if PHY strap is read

When the PHY's strap register is read to determine if lane swapping is
needed the phy_read_mmd returns the value back into the ret variable.

If the call to read the strap fails the failed value is returned.  If
the call to read the strap is successful then ret is possibly set to a
non-zero positive number. Without reseting the ret value to 0 this will
cause the parse DT function to return a failure.

Fixes: c97f9bd796ac1 ("net: phy: dp83869: Update port-mirroring to read straps")
Signed-off-by: Dan Murphy <dmurphy@ti.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/dp83869.c