Skip to content

Commit 0719bc3

Browse files
dtorkuba-moo
authored andcommitted
net: fec: do not double-parse 'phy-reset-active-high' property
Conversion to gpiod API done in commit 468ba54 ("fec: convert to gpio descriptor") clashed with gpiolib applying the same quirk to the reset GPIO polarity (introduced in commit b02c85c). This results in the reset line being left active/device being left in reset state when reset line is "active low". Remove handling of 'phy-reset-active-high' property from the driver and rely on gpiolib to apply needed adjustments to avoid ending up with the double inversion/flipped logic. Fixes: 468ba54 ("fec: convert to gpio descriptor") Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/20230201215320.528319-2-dmitry.torokhov@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent d7b5e5d commit 0719bc3

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/net/ethernet/freescale/fec_main.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4036,7 +4036,6 @@ static int fec_enet_init(struct net_device *ndev)
40364036
static int fec_reset_phy(struct platform_device *pdev)
40374037
{
40384038
struct gpio_desc *phy_reset;
4039-
bool active_high = false;
40404039
int msec = 1, phy_post_delay = 0;
40414040
struct device_node *np = pdev->dev.of_node;
40424041
int err;
@@ -4054,10 +4053,8 @@ static int fec_reset_phy(struct platform_device *pdev)
40544053
if (!err && phy_post_delay > 1000)
40554054
return -EINVAL;
40564055

4057-
active_high = of_property_read_bool(np, "phy-reset-active-high");
4058-
40594056
phy_reset = devm_gpiod_get_optional(&pdev->dev, "phy-reset",
4060-
active_high ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW);
4057+
GPIOD_OUT_HIGH);
40614058
if (IS_ERR(phy_reset))
40624059
return dev_err_probe(&pdev->dev, PTR_ERR(phy_reset),
40634060
"failed to get phy-reset-gpios\n");
@@ -4070,7 +4067,7 @@ static int fec_reset_phy(struct platform_device *pdev)
40704067
else
40714068
usleep_range(msec * 1000, msec * 1000 + 1000);
40724069

4073-
gpiod_set_value_cansleep(phy_reset, !active_high);
4070+
gpiod_set_value_cansleep(phy_reset, 0);
40744071

40754072
if (!phy_post_delay)
40764073
return 0;

0 commit comments

Comments
 (0)