diff options
| author | Bartosz Golaszewski <[email protected]> | 2025-04-08 07:19:55 +0000 |
|---|---|---|
| committer | Ilpo Järvinen <[email protected]> | 2025-04-11 11:05:14 +0000 |
| commit | 88f67f2a99f061cb938812db3deb965504cf5c5c (patch) | |
| tree | b61fffc745ee868502fa039ba83d525513cb99c1 /drivers/platform/x86/silicom-platform.c | |
| parent | platform/x86: int0002: use new GPIO line value setter callbacks (diff) | |
| download | kernel-88f67f2a99f061cb938812db3deb965504cf5c5c.tar.gz kernel-88f67f2a99f061cb938812db3deb965504cf5c5c.zip | |
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 <[email protected]>
Reviewed-by: Hans de Goede <[email protected]>
Link: https://lore.kernel.org/r/20250408-gpiochip-set-rv-platform-x86-v1-3-6f67e76a722c@linaro.org
Reviewed-by: Ilpo Järvinen <[email protected]>
Signed-off-by: Ilpo Järvinen <[email protected]>
Diffstat (limited to 'drivers/platform/x86/silicom-platform.c')
| -rw-r--r-- | drivers/platform/x86/silicom-platform.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/platform/x86/silicom-platform.c b/drivers/platform/x86/silicom-platform.c index c0910af16a3a..021f3fed197a 100644 --- a/drivers/platform/x86/silicom-platform.c +++ b/drivers/platform/x86/silicom-platform.c @@ -245,18 +245,19 @@ static int silicom_gpio_direction_input(struct gpio_chip *gc, return direction == GPIO_LINE_DIRECTION_IN ? 0 : -EINVAL; } -static void silicom_gpio_set(struct gpio_chip *gc, - unsigned int offset, - int value) +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; + return -EPERM; silicom_mec_port_set(channel, !value); + + return 0; } static int silicom_gpio_direction_output(struct gpio_chip *gc, @@ -469,7 +470,7 @@ static struct gpio_chip silicom_gpio_chip = { .direction_input = silicom_gpio_direction_input, .direction_output = silicom_gpio_direction_output, .get = silicom_gpio_get, - .set = silicom_gpio_set, + .set_rv = silicom_gpio_set, .base = -1, .ngpio = ARRAY_SIZE(plat_0222_gpio_channels), .names = plat_0222_gpio_names, |
