Message ID | 20190623151257.13660-1-marex@denx.de |
---|---|
State | Accepted |
Delegated to: | David Miller |
Headers | show |
Series | [V2] net: dsa: microchip: Use gpiod_set_value_cansleep() | expand |
On Sun, Jun 23, 2019 at 5:14 PM Marek Vasut <marex@denx.de> wrote: > Replace gpiod_set_value() with gpiod_set_value_cansleep(), as the switch > reset GPIO can be connected to e.g. I2C GPIO expander and it is perfectly > fine for the kernel to sleep for a bit in ksz_switch_register(). > > Signed-off-by: Marek Vasut <marex@denx.de> > Cc: Andrew Lunn <andrew@lunn.ch> > Cc: Florian Fainelli <f.fainelli@gmail.com> > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: Tristram Ha <Tristram.Ha@microchip.com> > Cc: Woojung Huh <Woojung.Huh@microchip.com> > Reviewed-by: Andrew Lunn <andrew@lunn.ch> > --- > V2: use _cansleep in .remove as well Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Yours, Linus Walleij
From: Marek Vasut <marex@denx.de> Date: Sun, 23 Jun 2019 17:12:57 +0200 > Replace gpiod_set_value() with gpiod_set_value_cansleep(), as the switch > reset GPIO can be connected to e.g. I2C GPIO expander and it is perfectly > fine for the kernel to sleep for a bit in ksz_switch_register(). > > Signed-off-by: Marek Vasut <marex@denx.de> > Cc: Andrew Lunn <andrew@lunn.ch> > Cc: Florian Fainelli <f.fainelli@gmail.com> > Cc: Linus Walleij <linus.walleij@linaro.org> > Cc: Tristram Ha <Tristram.Ha@microchip.com> > Cc: Woojung Huh <Woojung.Huh@microchip.com> > Reviewed-by: Andrew Lunn <andrew@lunn.ch> > --- > V2: use _cansleep in .remove as well Applied, thank you.
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index 4f6648d5ac8b..978c59aa8efb 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -436,9 +436,9 @@ int ksz_switch_register(struct ksz_device *dev, return PTR_ERR(dev->reset_gpio); if (dev->reset_gpio) { - gpiod_set_value(dev->reset_gpio, 1); + gpiod_set_value_cansleep(dev->reset_gpio, 1); mdelay(10); - gpiod_set_value(dev->reset_gpio, 0); + gpiod_set_value_cansleep(dev->reset_gpio, 0); } mutex_init(&dev->dev_mutex); @@ -489,7 +489,7 @@ void ksz_switch_remove(struct ksz_device *dev) dsa_unregister_switch(dev->ds); if (dev->reset_gpio) - gpiod_set_value(dev->reset_gpio, 1); + gpiod_set_value_cansleep(dev->reset_gpio, 1); } EXPORT_SYMBOL(ksz_switch_remove);