netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: lan743x: clean up a check in lan743x_netdev_open()
@ 2024-09-14  9:59 Dan Carpenter
  2024-09-14 15:46 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2024-09-14  9:59 UTC (permalink / raw)
  To: Bryan Whitehead, Raju Lakkaraju
  Cc: UNGLinuxDriver, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, netdev, linux-kernel, kernel-janitors

The "adapter->netdev->phydev" and "netdev->phydev" pointers are different
names for the same thing.  Use them consistently.  It makes the code more
clear to humans and static checkers alike.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
I noticed a different static checker warning that I never reported because it
was too old.  However, I think it's a valid issue.
drivers/net/ethernet/microchip/lan743x_main.c:109 lan743x_pci_init() warn: missing error code 'ret'
I think we should set an error code on that path.  It disables the PCI device
and then we continue to do PCI stuff even though the device is disabled.

 drivers/net/ethernet/microchip/lan743x_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
index 4dc5adcda6a3..0b8c82ff5e8e 100644
--- a/drivers/net/ethernet/microchip/lan743x_main.c
+++ b/drivers/net/ethernet/microchip/lan743x_main.c
@@ -3262,7 +3262,7 @@ static int lan743x_netdev_open(struct net_device *netdev)
 		phy_support_eee(netdev->phydev);
 
 #ifdef CONFIG_PM
-	if (adapter->netdev->phydev) {
+	if (netdev->phydev) {
 		struct ethtool_wolinfo wol = { .cmd = ETHTOOL_GWOL };
 
 		phy_ethtool_get_wol(netdev->phydev, &wol);
-- 
2.45.2


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

end of thread, other threads:[~2024-09-14 15:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-14  9:59 [PATCH net-next] net: lan743x: clean up a check in lan743x_netdev_open() Dan Carpenter
2024-09-14 15:46 ` Simon Horman

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).