gpio: tps65219: don't use CONFIG_DEBUG_GPIO
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Thu, 21 Dec 2023 18:57:02 +0000 (19:57 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 27 Dec 2023 14:56:48 +0000 (15:56 +0100)
CONFIG_DEBUG_GPIO should only be used to enable debug log messages and
for core GPIOLIB debugging. Don't use it to control the execution of
potentially buggy code. Just put it under an always-false #if.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-tps65219.c

index 7b38aa36011284ff735296257692fe29d0d3452e..cd1f17041f8c04baf3a0d2f8309ff227dc578f10 100644 (file)
@@ -96,16 +96,16 @@ static int tps65219_gpio_change_direction(struct gpio_chip *gc, unsigned int off
         * Below can be used for test purpose only.
         */
 
-       if (IS_ENABLED(CONFIG_DEBUG_GPIO)) {
-               int ret = regmap_update_bits(gpio->tps->regmap, TPS65219_REG_MFP_1_CONFIG,
-                                            TPS65219_GPIO0_DIR_MASK, direction);
-               if (ret) {
-                       dev_err(dev,
-                               "GPIO DEBUG enabled: Fail to change direction to %u for GPIO%d.\n",
-                               direction, offset);
-                       return ret;
-               }
+#if 0
+       int ret = regmap_update_bits(gpio->tps->regmap, TPS65219_REG_MFP_1_CONFIG,
+                                    TPS65219_GPIO0_DIR_MASK, direction);
+       if (ret) {
+               dev_err(dev,
+                       "GPIO DEBUG enabled: Fail to change direction to %u for GPIO%d.\n",
+                       direction, offset);
+               return ret;
        }
+#endif
 
        dev_err(dev,
                "GPIO%d direction set by NVM, change to %u failed, not allowed by specification\n",