]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
gpiolib: Even more opportunities to use str_high_low() helper
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 5 Feb 2025 11:29:36 +0000 (13:29 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 11 Feb 2025 08:45:30 +0000 (09:45 +0100)
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 <krzysztof.kozlowski@linaro.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250205112936.575493-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpiolib.c

index be335158350896e7867fc0d5cb0da9c953ea52ff..618fe2eebf3809500b3d4191a273bfa2ca8ae514 100644 (file)
@@ -4712,10 +4712,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;
 }