Skip to content

Commit 9a0384c

Browse files
Sergei Shtylyovdavem330
authored andcommitted
macb: fix PHY reset
The driver calls gpiod_set_value() with GPIOD_OUT_* instead of 0 and 1, as a result the PHY isn't really put back into reset state in macb_remove(). Moreover, the driver assumes that something else has set the GPIO direction to output, so if it has not, the PHY may not be taken out of reset in macb_probe() either... Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 4cfc86f commit 9a0384c

File tree

1 file changed

+2
-2
lines changed
  • drivers/net/ethernet/cadence

1 file changed

+2
-2
lines changed

drivers/net/ethernet/cadence/macb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2959,7 +2959,7 @@ static int macb_probe(struct platform_device *pdev)
29592959
int gpio = of_get_named_gpio(phy_node, "reset-gpios", 0);
29602960
if (gpio_is_valid(gpio))
29612961
bp->reset_gpio = gpio_to_desc(gpio);
2962-
gpiod_set_value(bp->reset_gpio, GPIOD_OUT_HIGH);
2962+
gpiod_direction_output(bp->reset_gpio, 1);
29632963
}
29642964
of_node_put(phy_node);
29652965

@@ -3029,7 +3029,7 @@ static int macb_remove(struct platform_device *pdev)
30293029
mdiobus_free(bp->mii_bus);
30303030

30313031
/* Shutdown the PHY if there is a GPIO reset */
3032-
gpiod_set_value(bp->reset_gpio, GPIOD_OUT_LOW);
3032+
gpiod_set_value(bp->reset_gpio, 0);
30333033

30343034
unregister_netdev(dev);
30353035
clk_disable_unprepare(bp->tx_clk);

0 commit comments

Comments
 (0)