]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
platform/x86: silicom: remove unnecessary GPIO line direction check
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Thu, 12 Jun 2025 07:48:35 +0000 (09:48 +0200)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Fri, 13 Jun 2025 09:33:25 +0000 (12:33 +0300)
As of commit 92ac7de3175e3 ("gpiolib: don't allow setting values on input
lines"), the GPIO core makes sure values cannot be set on input lines.
Remove the unnecessary check.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20250612074835.13800-1-brgl@bgdev.pl
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/silicom-platform.c

index 021f3fed197a69dc10bb8983c7a17986ca2fb69c..63b5da410ed57dea8023bfd559905d266a3ff5c5 100644 (file)
@@ -248,13 +248,9 @@ static int silicom_gpio_direction_input(struct gpio_chip *gc,
 static int silicom_gpio_set(struct gpio_chip *gc, unsigned int offset,
                            int value)
 {
-       int direction = silicom_gpio_get_direction(gc, offset);
        u8 *channels = gpiochip_get_data(gc);
        int channel = channels[offset];
 
-       if (direction == GPIO_LINE_DIRECTION_IN)
-               return -EPERM;
-
        silicom_mec_port_set(channel, !value);
 
        return 0;