Skip to content

Commit

Permalink
net: ks8851: Reassert reset pin if chip ID check fails
Browse files Browse the repository at this point in the history
Commit 73fdeb8 ("net: ks8851: Add optional vdd_io regulator and
reset gpio") amended the ks8851 driver to briefly assert the chip's
reset pin on probe. It also amended the probe routine's error path to
reassert the reset pin if a subsequent initialization step fails.

However the commit misplaced reassertion of the reset pin in the error
path such that it is not performed if the check of the Chip ID and
Enable Register (CIDER) fails. The error path is therefore slightly
asymmetrical to the probe routine's body. Fix it.

Signed-off-by: Lukas Wunner <[email protected]>
Cc: Frank Pavlic <[email protected]>
Cc: Stephen Boyd <[email protected]>
Cc: Nishanth Menon <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
l1k authored and davem330 committed Mar 20, 2019
1 parent 536d368 commit 761cfa9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/micrel/ks8851.c
Original file line number Diff line number Diff line change
Expand Up @@ -1554,9 +1554,9 @@ static int ks8851_probe(struct spi_device *spi)
free_irq(ndev->irq, ks);

err_irq:
err_id:
if (gpio_is_valid(gpio))
gpio_set_value(gpio, 0);
err_id:
regulator_disable(ks->vdd_reg);
err_reg:
regulator_disable(ks->vdd_io);
Expand Down

0 comments on commit 761cfa9

Please sign in to comment.