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: barco-p50: 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>
Acked-by: Peter Korsgaard <peter.korsgaard@barco.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20250408-gpiochip-set-rv-platform-x86-v1-1-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
29ba3b60 8625c4c0

+7 -3
+7 -3
drivers/platform/x86/barco-p50-gpio.c
··· 268 268 return ret; 269 269 } 270 270 271 - static void p50_gpio_set(struct gpio_chip *gc, unsigned int offset, int value) 271 + static int p50_gpio_set(struct gpio_chip *gc, unsigned int offset, int value) 272 272 { 273 273 struct p50_gpio *p50 = gpiochip_get_data(gc); 274 + int ret; 274 275 275 276 mutex_lock(&p50->lock); 276 277 277 - p50_send_mbox_cmd(p50, P50_MBOX_CMD_WRITE_GPIO, gpio_params[offset], value); 278 + ret = p50_send_mbox_cmd(p50, P50_MBOX_CMD_WRITE_GPIO, 279 + gpio_params[offset], value); 278 280 279 281 mutex_unlock(&p50->lock); 282 + 283 + return ret; 280 284 } 281 285 282 286 static int p50_gpio_probe(struct platform_device *pdev) ··· 316 312 p50->gc.base = -1; 317 313 p50->gc.get_direction = p50_gpio_get_direction; 318 314 p50->gc.get = p50_gpio_get; 319 - p50->gc.set = p50_gpio_set; 315 + p50->gc.set_rv = p50_gpio_set; 320 316 321 317 322 318 /* reset mbox */