Unverified Commit 5a7c909a authored by Bartosz Golaszewski's avatar Bartosz Golaszewski Committed by Ilpo Järvinen
Browse files

platform/x86: silicom: remove unnecessary GPIO line direction check



As of commit 92ac7de3 ("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: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20250612074835.13800-1-brgl@bgdev.pl


Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
parent 05651018
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -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;