netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Issue with commit fea23fb591cc "net: phy: convert read-modify-write to phy_modify()"
@ 2018-01-04  7:00 Heiner Kallweit
  2018-01-04 11:44 ` Russell King - ARM Linux
  2018-01-04 12:59 ` Andrew Lunn
  0 siblings, 2 replies; 6+ messages in thread
From: Heiner Kallweit @ 2018-01-04  7:00 UTC (permalink / raw)
  To: Russell King, Andrew Lunn, David S. Miller; +Cc: netdev@vger.kernel.org

Parameter mask of phy_modify() holds the bits to be cleared.
In the mentioned commit parameter mask seems to be inverted in
few cases, what IMO is wrong (see example).
Maybe I miss something, could you please check?

And somehow related:
When adding such helpers, wouldn't it make sense to add
helpers for setting / clearing bits too? Something like:
phy_set_bits(phydev, reg, val) -> phy_modify(phydev, reg, 0, val)

Rgds, Heiner


 int genphy_resume(struct phy_device *phydev)
 {
-	int value;
-
-	value = phy_read(phydev, MII_BMCR);
-	phy_write(phydev, MII_BMCR, value & ~BMCR_PDOWN);
-
-	return 0;
+	return phy_modify(phydev, MII_BMCR, ~BMCR_PDOWN, 0);
 }

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-01-05  1:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-04  7:00 Issue with commit fea23fb591cc "net: phy: convert read-modify-write to phy_modify()" Heiner Kallweit
2018-01-04 11:44 ` Russell King - ARM Linux
2018-01-04 19:16   ` Heiner Kallweit
2018-01-05  0:44   ` Ivan Khoronzhuk
2018-01-05  1:02     ` Russell King - ARM Linux
2018-01-04 12:59 ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).