net: phy: phylink: Use gpiod_get_value_cansleep()
authorFlorian Fainelli <f.fainelli@gmail.com>
Thu, 10 May 2018 20:17:29 +0000 (13:17 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 May 2018 16:03:05 +0000 (12:03 -0400)
The GPIO provider for the link GPIO line might require the use of the
_cansleep() API, utilize that. This is safe to do since we run in workqueue
context.

Fixes: 9525ae83959b ("phylink: add phylink infrastructure")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phylink.c

index c582b2d7546c3359e858e826ddac2dab68b481c7..412d1cf4fa6631505efe99072ff6c0c0fc4425fa 100644 (file)
@@ -360,7 +360,7 @@ static void phylink_get_fixed_state(struct phylink *pl, struct phylink_link_stat
        if (pl->get_fixed_state)
                pl->get_fixed_state(pl->netdev, state);
        else if (pl->link_gpio)
-               state->link = !!gpiod_get_value(pl->link_gpio);
+               state->link = !!gpiod_get_value_cansleep(pl->link_gpio);
 }
 
 /* Flow control is resolved according to our and the link partners