Skip to content

Commit

Permalink
net: dsa: ksz: ksz8863_smi_probe: set proper return value for ksz_swi…
Browse files Browse the repository at this point in the history
…tch_alloc()

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

Fixes: 60a3647 ("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>
  • Loading branch information
Oleksij Rempel authored and David S. Miller committed Apr 29, 2021
1 parent ba46b57 commit d4eecfb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/dsa/microchip/ksz8863_smi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit d4eecfb

Please sign in to comment.