Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

platform/x86: silicom: use new GPIO line value setter callbacks

struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20250408-gpiochip-set-rv-platform-x86-v1-3-6f67e76a722c@linaro.org
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

authored by

Bartosz Golaszewski and committed by
Ilpo Järvinen
88f67f2a e0071ad2

+6 -5
+6 -5
drivers/platform/x86/silicom-platform.c
··· 245 245 return direction == GPIO_LINE_DIRECTION_IN ? 0 : -EINVAL; 246 246 } 247 247 248 - static void silicom_gpio_set(struct gpio_chip *gc, 249 - unsigned int offset, 250 - int value) 248 + static int silicom_gpio_set(struct gpio_chip *gc, unsigned int offset, 249 + int value) 251 250 { 252 251 int direction = silicom_gpio_get_direction(gc, offset); 253 252 u8 *channels = gpiochip_get_data(gc); 254 253 int channel = channels[offset]; 255 254 256 255 if (direction == GPIO_LINE_DIRECTION_IN) 257 - return; 256 + return -EPERM; 258 257 259 258 silicom_mec_port_set(channel, !value); 259 + 260 + return 0; 260 261 } 261 262 262 263 static int silicom_gpio_direction_output(struct gpio_chip *gc, ··· 470 469 .direction_input = silicom_gpio_direction_input, 471 470 .direction_output = silicom_gpio_direction_output, 472 471 .get = silicom_gpio_get, 473 - .set = silicom_gpio_set, 472 + .set_rv = silicom_gpio_set, 474 473 .base = -1, 475 474 .ngpio = ARRAY_SIZE(plat_0222_gpio_channels), 476 475 .names = plat_0222_gpio_names,