Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 60a364760002 ("net: dsa: microchip: Add Microchip KSZ8863 SMI based driver support")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Oleksij Rempel and committed by
David S. Miller
d4eecfb2 ba46b576

+1 -1
+1 -1
drivers/net/dsa/microchip/ksz8863_smi.c
··· 154 154 155 155 dev = ksz_switch_alloc(&mdiodev->dev, ksz8); 156 156 if (!dev) 157 - return -EINVAL; 157 + return -ENOMEM; 158 158 159 159 for (i = 0; i < ARRAY_SIZE(ksz8863_regmap_config); i++) { 160 160 rc = ksz8863_regmap_config[i];