OSDN Git Service

net: phy: at803x: simplify custom phy id matching
authorRussell King <rmk+kernel@armlinux.org.uk>
Tue, 20 Jul 2021 13:33:49 +0000 (14:33 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Jul 2021 14:27:01 +0000 (07:27 -0700)
commit8887ca5474bd9ddb56cabc88856bb035774e0041
tree80164db7094202dcd914e970ed4c7f69c6ec92f4
parentfa660684e5319a5c37deaf4a329d8026b52d64e7
net: phy: at803x: simplify custom phy id matching

The at803x driver contains a function, at803x_match_phy_id(), which
tests whether the PHY ID matches the value passed, comparing phy_id
with phydev->phy_id and testing all bits that in the driver's mask.

This is the same test that is used to match the driver, with phy_id
replaced with the driver specified ID, phydev->drv->phy_id.

Hence, we already know the value of the bits being tested if we look
at phydev->drv->phy_id directly, and we do not require a complicated
test to check them. Test directly against phydev->drv->phy_id instead.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/at803x.c