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

gpio: remove legacy GPIO line value setter callbacks

With no more users of the legacy GPIO line value setters - .set() and
.set_multiple() - we can now remove them from the kernel.

Link: https://lore.kernel.org/r/20250725074651.14002-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

+6 -28
+6 -21
drivers/gpio/gpiolib.c
··· 1037 1037 int base = 0; 1038 1038 int ret; 1039 1039 1040 - /* Only allow one set() and one set_multiple(). */ 1041 - if ((gc->set && gc->set_rv) || 1042 - (gc->set_multiple && gc->set_multiple_rv)) 1043 - return -EINVAL; 1044 - 1045 1040 /* 1046 1041 * First: allocate and populate the internal stat container, and 1047 1042 * set up the struct device. ··· 2886 2891 2887 2892 lockdep_assert_held(&gc->gpiodev->srcu); 2888 2893 2889 - if (WARN_ON(unlikely(!gc->set && !gc->set_rv))) 2894 + if (WARN_ON(unlikely(!gc->set_rv))) 2890 2895 return -EOPNOTSUPP; 2891 2896 2892 - if (gc->set_rv) { 2893 - ret = gc->set_rv(gc, offset, value); 2894 - if (ret > 0) 2895 - ret = -EBADE; 2897 + ret = gc->set_rv(gc, offset, value); 2898 + if (ret > 0) 2899 + ret = -EBADE; 2896 2900 2897 - return ret; 2898 - } 2899 - 2900 - gc->set(gc, offset, value); 2901 - return 0; 2901 + return ret; 2902 2902 } 2903 2903 2904 2904 static int gpiod_direction_output_raw_commit(struct gpio_desc *desc, int value) ··· 2909 2919 * output-only, but if there is then not even a .set() operation it 2910 2920 * is pretty tricky to drive the output line. 2911 2921 */ 2912 - if (!guard.gc->set && !guard.gc->set_rv && !guard.gc->direction_output) { 2922 + if (!guard.gc->set_rv && !guard.gc->direction_output) { 2913 2923 gpiod_warn(desc, 2914 2924 "%s: missing set() and direction_output() operations\n", 2915 2925 __func__); ··· 3661 3671 ret = -EBADE; 3662 3672 3663 3673 return ret; 3664 - } 3665 - 3666 - if (gc->set_multiple) { 3667 - gc->set_multiple(gc, mask, bits); 3668 - return 0; 3669 3674 } 3670 3675 3671 3676 /* set outputs if the corresponding mask bit is set */
-7
include/linux/gpio/driver.h
··· 347 347 * @get: returns value for signal "offset", 0=low, 1=high, or negative error 348 348 * @get_multiple: reads values for multiple signals defined by "mask" and 349 349 * stores them in "bits", returns 0 on success or negative error 350 - * @set: **DEPRECATED** - please use set_rv() instead 351 - * @set_multiple: **DEPRECATED** - please use set_multiple_rv() instead 352 350 * @set_rv: assigns output value for signal "offset", returns 0 on success or 353 351 * negative error value 354 352 * @set_multiple_rv: assigns output values for multiple signals defined by ··· 441 443 int (*get)(struct gpio_chip *gc, 442 444 unsigned int offset); 443 445 int (*get_multiple)(struct gpio_chip *gc, 444 - unsigned long *mask, 445 - unsigned long *bits); 446 - void (*set)(struct gpio_chip *gc, 447 - unsigned int offset, int value); 448 - void (*set_multiple)(struct gpio_chip *gc, 449 446 unsigned long *mask, 450 447 unsigned long *bits); 451 448 int (*set_rv)(struct gpio_chip *gc,