Commit 9cc8d0ec authored by Rosen Penev's avatar Rosen Penev Committed by Paolo Abeni
Browse files

net: mdio-ipq4019: add missing error check



If an optional resource is found but fails to remap, return on failure.
Avoids any potential problems when using the iomapped resource as the
assumption is that it's available.

Fixes: 23a890d4 ("net: mdio: Add the reset function for IPQ MDIO driver")
Signed-off-by: default avatarRosen Penev <rosenp@gmail.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20241121193152.8966-1-rosenp@gmail.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 82159e6a
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -352,8 +352,11 @@ static int ipq4019_mdio_probe(struct platform_device *pdev)
	/* The platform resource is provided on the chipset IPQ5018 */
	/* This resource is optional */
	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
	if (res)
	if (res) {
		priv->eth_ldo_rdy = devm_ioremap_resource(&pdev->dev, res);
		if (IS_ERR(priv->eth_ldo_rdy))
			return PTR_ERR(priv->eth_ldo_rdy);
	}

	bus->name = "ipq4019_mdio";
	bus->read = ipq4019_mdio_read_c22;