]> 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)
commit8370c82718c4d2287a2518bcb53b4570dba44e92
tree8ba17af4c910c65ebdbe68f07c380630e51058ca
parent44dfda2177624e6953e371d0758396e219af978a
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: ee850b1a4111 ("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