]> git.baikalelectronics.ru Git - kernel.git/commit
net: mdio-ipq4019: Fix the error for an optional regs resource
authorCai Huoqing <caihuoqing@baidu.com>
Tue, 28 Sep 2021 13:48:49 +0000 (21:48 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 29 Sep 2021 00:28:54 +0000 (17:28 -0700)
commit48aeeb6d51a337926c6cfbb0057bdbb31f788f6b
tree8ba17af4c910c65ebdbe68f07c380630e51058ca
parent607bc756d4b9353d3561c6b654503cda4890b7c4
net: mdio-ipq4019: Fix the error for an optional regs resource

The second resource is optional which is only provided on the chipset
IPQ5018. But the blamed commit ignores that and if the resource is
not there it just fails.

the resource is used like this,
if (priv->eth_ldo_rdy) {
val = readl(priv->eth_ldo_rdy);
val |= BIT(0);
writel(val, priv->eth_ldo_rdy);
fsleep(IPQ_PHY_SET_DELAY_US);
}

This patch reverts that to still allow the second resource to be optional
because other SoC have the some MDIO controller and doesn't need to
second resource.

Fixes: d5ece011747b ("net: mdio-ipq4019: Make use of devm_platform_ioremap_resource()")
Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20210928134849.2092-1-caihuoqing@baidu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/mdio/mdio-ipq4019.c