Skip to contentSkip to conversation

net: dsa: microchip: Use gpiod_set_value_cansleep()

PATCH Superseded Marek Vasut 2 participants 3 messages Jun 23, 2019

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: dsa: microchip: Use gpiod_set_value_cansleep()

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().

Cc Andrew Lunn <[email protected]>
Cc Florian Fainelli <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Tristram Ha <[email protected]>
Cc Woojung Huh <[email protected]>
---
 drivers/net/dsa/microchip/ksz_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/dsa/microchip/ksz_common.c +2 -2
index 4f6648d5ac8b..bc81806dd75e 100644
@@ -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);
Signature · 1 line
2.20.1
#2 lore raw
Quoted 8 lines · Andrew Lunn
Quoted 5 lines · Marek Vasut

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().

Actually, no, I missed a change in .remove , so I'll send a V2 with this RB if you don't mind.

Signature · 2 lines
Best regards,
Marek Vasut