]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
usb: phy-generic: Use gpiod_set_value_cansleep
authorMike Looijmans <mike.looijmans@topic.nl>
Wed, 21 Feb 2018 15:04:01 +0000 (16:04 +0100)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 13 Mar 2018 08:47:52 +0000 (10:47 +0200)
The nop_reset and shutdown methods are called in a context that can sleep,
so use gpiod_set_value_cansleep instead of gpiod_set_value.

If you've connected the reset line to a GPIO expander, you'd get a kernel
"slowpath" warning with gpiod_set_value.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/phy/phy-generic.c

index 74ba88297991b76243f7bb666b82b1c2ca2312fd..a53b89be5324819479e5d346d1f165b37daad55d 100644 (file)
@@ -63,9 +63,9 @@ static void nop_reset(struct usb_phy_generic *nop)
        if (!nop->gpiod_reset)
                return;
 
-       gpiod_set_value(nop->gpiod_reset, 1);
+       gpiod_set_value_cansleep(nop->gpiod_reset, 1);
        usleep_range(10000, 20000);
-       gpiod_set_value(nop->gpiod_reset, 0);
+       gpiod_set_value_cansleep(nop->gpiod_reset, 0);
 }
 
 /* interface to regulator framework */
@@ -159,7 +159,7 @@ void usb_gen_phy_shutdown(struct usb_phy *phy)
 {
        struct usb_phy_generic *nop = dev_get_drvdata(phy->dev);
 
-       gpiod_set_value(nop->gpiod_reset, 1);
+       gpiod_set_value_cansleep(nop->gpiod_reset, 1);
 
        if (!IS_ERR(nop->clk))
                clk_disable_unprepare(nop->clk);