提交 d4eecfb2 编写于 作者: O Oleksij Rempel 提交者: David S. Miller

net: dsa: ksz: ksz8863_smi_probe: set proper return value for ksz_switch_alloc()

ksz_switch_alloc() will return NULL only if allocation is failed. So,
the proper return value is -ENOMEM.

Fixes: 60a36476 ("net: dsa: microchip: Add Microchip KSZ8863 SMI based driver support")
Signed-off-by: NOleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ba46b576
......@@ -154,7 +154,7 @@ static int ksz8863_smi_probe(struct mdio_device *mdiodev)
dev = ksz_switch_alloc(&mdiodev->dev, ksz8);
if (!dev)
return -EINVAL;
return -ENOMEM;
for (i = 0; i < ARRAY_SIZE(ksz8863_regmap_config); i++) {
rc = ksz8863_regmap_config[i];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册