Skip to contentSkip to conversation

gpiolib: Even more opportunities to use str_high_low() helper

PATCH Applied Andy Shevchenko 2 participants 2 messages Feb 5, 2025 – Feb 11, 2025 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpiolib: Even more opportunities to use str_high_low() helper

The one of previous changes modified the library code to use helpers from string_choices.h. Nevertheless it misses more opportunities to convert the code. Here is the second part of the conversion.

Cc Krzysztof Kozlowski <[email protected]>
---
 drivers/gpio/gpiolib.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpio/gpiolib.c +2 -2
index 2a58b84766f8..98fba0c392ea 100644
@@ -4721,10 +4721,10 @@ int gpiod_hog(struct gpio_desc *desc, const char *name,
 		return ret;
 	}
 
-	gpiod_dbg(desc, "hogged as %s%s\n",
+	gpiod_dbg(desc, "hogged as %s/%s\n",
 		(dflags & GPIOD_FLAGS_BIT_DIR_OUT) ? "output" : "input",
 		(dflags & GPIOD_FLAGS_BIT_DIR_OUT) ?
-		  (dflags & GPIOD_FLAGS_BIT_DIR_VAL) ? "/high" : "/low" : "");
+		  str_high_low(dflags & GPIOD_FLAGS_BIT_DIR_VAL) : "?");
 
 	return 0;
 }
Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac
#1 lore raw

From: Bartosz Golaszewski <[email protected]>

Quoted 6 lines · Andy Shevchenko

The one of previous changes modified the library code to use helpers from string_choices.h. Nevertheless it misses more opportunities to convert the code. Here is the second part of the conversion.

Applied, thanks!

[1/1] gpiolib: Even more opportunities to use str_high_low() helper

      commit: 5f05e9194ada5609edbefb542c0dbfdbae984958

Best regards,

Signature · 1 line
Bartosz Golaszewski <[email protected]>