Skip to content

Commit d4eecfb

Browse files
oleremdavem330
authored andcommitted
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: 60a3647 ("net: dsa: microchip: Add Microchip KSZ8863 SMI based driver support") Signed-off-by: Oleksij Rempel <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ba46b57 commit d4eecfb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/dsa/microchip/ksz8863_smi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static int ksz8863_smi_probe(struct mdio_device *mdiodev)
154154

155155
dev = ksz_switch_alloc(&mdiodev->dev, ksz8);
156156
if (!dev)
157-
return -EINVAL;
157+
return -ENOMEM;
158158

159159
for (i = 0; i < ARRAY_SIZE(ksz8863_regmap_config); i++) {
160160
rc = ksz8863_regmap_config[i];

0 commit comments

Comments
 (0)