* [PATCH] net: dsa: microchip: Use gpiod_set_value_cansleep()
@ 2019-06-23 12:10 Marek Vasut
2019-06-23 15:09 ` Andrew Lunn
0 siblings, 1 reply; 3+ messages in thread
From: Marek Vasut @ 2019-06-23 12:10 UTC (permalink / raw)
To: netdev
Cc: Marek Vasut, Andrew Lunn, Florian Fainelli, Linus Walleij,
Tristram Ha, Woojung Huh
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>
---
drivers/net/dsa/microchip/ksz_common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index 4f6648d5ac8b..bc81806dd75e 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);
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net: dsa: microchip: Use gpiod_set_value_cansleep()
2019-06-23 12:10 [PATCH] net: dsa: microchip: Use gpiod_set_value_cansleep() Marek Vasut
@ 2019-06-23 15:09 ` Andrew Lunn
2019-06-23 15:12 ` Marek Vasut
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Lunn @ 2019-06-23 15:09 UTC (permalink / raw)
To: Marek Vasut
Cc: netdev, Florian Fainelli, Linus Walleij, Tristram Ha, Woojung Huh
On Sun, Jun 23, 2019 at 02:10:36PM +0200, Marek Vasut 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>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: dsa: microchip: Use gpiod_set_value_cansleep()
2019-06-23 15:09 ` Andrew Lunn
@ 2019-06-23 15:12 ` Marek Vasut
0 siblings, 0 replies; 3+ messages in thread
From: Marek Vasut @ 2019-06-23 15:12 UTC (permalink / raw)
To: Andrew Lunn
Cc: netdev, Florian Fainelli, Linus Walleij, Tristram Ha, Woojung Huh
On 6/23/19 5:09 PM, Andrew Lunn wrote:
> On Sun, Jun 23, 2019 at 02:10:36PM +0200, Marek Vasut 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>
>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Actually, no, I missed a change in .remove , so I'll send a V2 with this
RB if you don't mind.
--
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-06-23 15:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-23 12:10 [PATCH] net: dsa: microchip: Use gpiod_set_value_cansleep() Marek Vasut
2019-06-23 15:09 ` Andrew Lunn
2019-06-23 15:12 ` Marek Vasut
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.