netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: mdio-ipq4019: fix wrong NULL check
@ 2024-11-17 21:28 Rosen Penev
  2024-11-18 10:26 ` Jie Luo
  0 siblings, 1 reply; 5+ messages in thread
From: Rosen Penev @ 2024-11-17 21:28 UTC (permalink / raw)
  To: netdev
  Cc: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Luo Jie, open list

devm_ioremap_resource returns a PTR_ERR when it fails, not NULL. OTOH
this is conditionally set to either a PTR_ERR or a valid pointer. Use
!IS_ERR_OR_NULL to check if we can use this.

Fixes: 23a890d493 ("net: mdio: Add the reset function for IPQ MDIO driver")

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/net/mdio/mdio-ipq4019.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mdio/mdio-ipq4019.c b/drivers/net/mdio/mdio-ipq4019.c
index dd3ed2d6430b..859302b0d38c 100644
--- a/drivers/net/mdio/mdio-ipq4019.c
+++ b/drivers/net/mdio/mdio-ipq4019.c
@@ -256,7 +256,7 @@ static int ipq_mdio_reset(struct mii_bus *bus)
 	/* To indicate CMN_PLL that ethernet_ldo has been ready if platform resource 1
 	 * is specified in the device tree.
 	 */
-	if (priv->eth_ldo_rdy) {
+	if (!IS_ERR_OR_NULL(priv->eth_ldo_rdy)) {
 		val = readl(priv->eth_ldo_rdy);
 		val |= BIT(0);
 		writel(val, priv->eth_ldo_rdy);
-- 
2.47.0


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

end of thread, other threads:[~2024-11-19 10:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-17 21:28 [PATCH net] net: mdio-ipq4019: fix wrong NULL check Rosen Penev
2024-11-18 10:26 ` Jie Luo
2024-11-18 11:27   ` Russell King (Oracle)
2024-11-18 21:12     ` Rosen Penev
2024-11-19 10:54       ` Jie Luo

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