summaryrefslogtreecommitdiff
path: root/drivers/gpio
AgeCommit message (Collapse)Author
2025-04-30gpio: lp3943: use new line value setter callbacksBartosz Golaszewski
struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250423-gpiochip-set-rv-gpio-part2-v1-12-b22245cde81a@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-04-30gpio: loongson: use new line value setter callbacksBartosz Golaszewski
struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250423-gpiochip-set-rv-gpio-part2-v1-11-b22245cde81a@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-04-30gpio: loongson-64bit: use new line value setter callbacksBartosz Golaszewski
struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250423-gpiochip-set-rv-gpio-part2-v1-10-b22245cde81a@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-04-30gpio: logicvc: use new line value setter callbacksBartosz Golaszewski
struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250423-gpiochip-set-rv-gpio-part2-v1-9-b22245cde81a@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-04-30gpio: ljca: use new line value setter callbacksBartosz Golaszewski
struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250423-gpiochip-set-rv-gpio-part2-v1-8-b22245cde81a@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-04-30gpio: kempld: use new line value setter callbacksBartosz Golaszewski
struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250423-gpiochip-set-rv-gpio-part2-v1-7-b22245cde81a@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-04-30gpio: janz-ttl: use new line value setter callbacksBartosz Golaszewski
struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250423-gpiochip-set-rv-gpio-part2-v1-6-b22245cde81a@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-04-30gpio: it87: use new line value setter callbacksBartosz Golaszewski
struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250423-gpiochip-set-rv-gpio-part2-v1-5-b22245cde81a@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-04-30gpio: imx-scu: use new line value setter callbacksBartosz Golaszewski
struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250423-gpiochip-set-rv-gpio-part2-v1-4-b22245cde81a@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-04-30gpio: imx-scu: destroy the mutex in detach pathBartosz Golaszewski
Use devm_mutex_init() in order to clean up after the mutex debug data in detach and error path. Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250423-gpiochip-set-rv-gpio-part2-v1-3-b22245cde81a@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-04-30gpio: imx-scu: use lock guardsBartosz Golaszewski
Simplify the code by using lock guards from cleanup.h with the driver's mutex. Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250423-gpiochip-set-rv-gpio-part2-v1-2-b22245cde81a@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-04-30gpio: imx-scu: don't check the GPIO rangeBartosz Golaszewski
Core GPIO code already does this for drivers, no need to duplicate the check. Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250423-gpiochip-set-rv-gpio-part2-v1-1-b22245cde81a@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-04-28gpiolib: devres: Finish the conversion to use devm_add_action()Andy Shevchenko
With a recently added helper we can complete the conversion of the GPIOLIB code to use devm_add_action() in all suitable cases. So do this. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20250220162238.2738038-4-andriy.shevchenko@linux.intel.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-04-23gpio: pca953x: Add support for level-triggered interruptsPotin Lai
Adds support for level-triggered interrupts in the PCA953x GPIO expander driver. Previously, the driver only supported edge-triggered interrupts, which could lead to missed events in scenarios where an interrupt condition persists until it is explicitly cleared. By enabling level-triggered interrupts, the driver can now detect and respond to sustained interrupt conditions more reliably. Signed-off-by: Potin Lai <potin.lai.pt@gmail.com> Link: https://lore.kernel.org/r/20250409-gpio-pca953x-level-triggered-irq-v3-1-7f184d814934@gmail.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-04-23gpio: vf610: Allow building as a moduleJindong Yue
Support for building it as a module for use on the Android platform, because the Android kernel(GKI) doesn't contain board-specific drivers, it requires that these drivers be built as a module and loaded into the system. Signed-off-by: Jindong Yue <jindong.yue@nxp.com> Link: https://lore.kernel.org/r/20250416062605.1948856-1-jindong.yue@nxp.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-04-22gpio: Restrict GPIO_ICH to compile testing with HAS_IOPORTNathan Chancellor
When building gpio-ich.c for a platform that does not have IO port access like s390, there are several errors due to the use of inl() and outl() throughout the driver: drivers/gpio/gpio-ich.c: In function 'ichx_read_bit': include/asm-generic/io.h:578:14: error: call to '_inl' declared with attribute error: inl() requires CONFIG_HAS_IOPORT Only allow compile testing when the targeted platform selects HAS_IOPORT so that there are no compile time errors. Fixes: f3592d252f77 ("gpio: ich: enable building with COMPILE_TEST=y") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202504171941.g1yXja0j-lkp@intel.com/ Signed-off-by: Nathan Chancellor <nathan@kernel.org> Link: https://lore.kernel.org/r/20250418-gpio-ich-fix-build-without-ioport-v1-1-83fc753438ec@kernel.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
2025-04-17gpiolib: Remove redundant assignment of return variableAndy Shevchenko
In some functions the returned variable is assigned to 0 and then reassigned to the actual value. Remove redundant assignments. In one case make it more clear that the assignment is not needed. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20250416095645.2027695-9-andriy.shevchenko@linux.intel.com Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-17gpiolib: Reuse return variable in gpiod_to_irq()Andy Shevchenko
There are two variables for the same used in the gpiod_to_irq(). Replace the second by reusing the function top-level one. While at it, refactor the branch to have less lines of code. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20250416095645.2027695-8-andriy.shevchenko@linux.intel.com Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-17gpiolib: Call validate_desc() when VALIDATE_DESC() can't be usedAndy Shevchenko
Call validate_desc() directly when VALIDATE_DESC() can't be used. It will print additional information useful for debugging. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20250416095645.2027695-7-andriy.shevchenko@linux.intel.com Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-17gpiolib: Move validate_desc() and Co upper in the codeAndy Shevchenko
Move validate_desc() and Co upper in the code to be able to use in the further changes. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20250416095645.2027695-6-andriy.shevchenko@linux.intel.com Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-17gpiolib: Revert "Don't WARN on gpiod_put() for optional GPIO"Andy Shevchenko
No need to double check the pointer for NULL since gpiod_free() is using VALIDATE_DESC_VOID() which simply returns in that case. This reverts commit 1d7765ba15aca68f3bc52f59434c1c34855bbb54. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20250416095645.2027695-5-andriy.shevchenko@linux.intel.com Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-17gpiolib: Print actual error when descriptor contains an error pointerAndy Shevchenko
Print the actual error when descriptor contains an error pointer. This might help debugging those rare cases. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20250416095645.2027695-4-andriy.shevchenko@linux.intel.com Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-17gpiolib: Convert to use guard()() for gpio_machine_hogs_mutexAndy Shevchenko
The driver uses guard()()/scoped_guard() for the rest of the synchronisation calls. Convert to use the same for gpio_machine_hogs_mutex. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20250416095645.2027695-3-andriy.shevchenko@linux.intel.com Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-17gpiolib: Make taking gpio_lookup_lock consistentAndy Shevchenko
There are two ways to take a lock: plain call to the mutex_lock() or using guard()() / scoped_guard(). The driver inconsistently uses both. Make taking gpio_lookup_lock consistent. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20250416095645.2027695-2-andriy.shevchenko@linux.intel.com Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-17gpio: spacemit: add support for K1 SoCYixun Lan
Implement GPIO functionality which capable of setting pin as input, output. Also, each pin can be used as interrupt which support rising, falling, or both edge type trigger. Reviewed-by: Alex Elder <elder@riscstar.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Yixun Lan <dlan@gentoo.org> Link: https://lore.kernel.org/r/20250412-03-k1-gpio-v8-2-1c6862d272ec@gentoo.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-17gpio: tn48m: enable building the module with COMPILE_TEST=yBartosz Golaszewski
Extend the build coverage by allowing to build the module with COMPILE_TEST enabled. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250408-gpio-compile-test-v1-6-140e108e9392@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-17gpio: rtd: enable building the module with COMPILE_TEST=yBartosz Golaszewski
Extend the build coverage by allowing to build the module with COMPILE_TEST enabled. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250408-gpio-compile-test-v1-4-140e108e9392@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-17gpio: pl061: enable building the module with COMPILE_TEST=yBartosz Golaszewski
Extend the build coverage by allowing to build the module with COMPILE_TEST enabled. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250408-gpio-compile-test-v1-3-140e108e9392@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-17gpio: msc313: enable building the module with COMPILE_TEST=yBartosz Golaszewski
Extend the build coverage by allowing to build the module with COMPILE_TEST enabled. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250408-gpio-compile-test-v1-2-140e108e9392@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-17gpio: zynq: enable building the modules with COMPILE_TEST=yBartosz Golaszewski
Extend the build coverage by allowing to build the modules with COMPILE_TEST enabled. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250408-gpio-compile-test-v1-1-140e108e9392@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-17gpio: blzp1600: drop dependency on OF headersBartosz Golaszewski
Use the generic boolean device property getter instead of the OF-specific variant. This allows us to stop pulling in linux/of.h. While at it: drop the of_irq.h inclusion as none of its symbols are used in this driver. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Nikolaos Pasaloukos <nikolaos.pasaloukos@blaize.com> Link: https://lore.kernel.org/r/20250408143629.125576-1-brgl@bgdev.pl Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-17gpio: ds4520: don't check the 'ngpios' property in the driverBartosz Golaszewski
This is already done by the gpio-regmap abstraction by calling gpiochip_get_ngpios(). We don't need to do this at the driver level. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://lore.kernel.org/r/20250408-gpio-regmap-ngpios-v2-1-26f254014f57@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-17gpio: ich: use new line value setter callbacksBartosz Golaszewski
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> Link: https://lore.kernel.org/r/20250407-gpiochip-set-rv-gpio-part1-v1-12-78399683ca38@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-17gpio: ich: enable building with COMPILE_TEST=yBartosz Golaszewski
Extend the build coverage by allowing to build the module with COMPILE_TEST enabled. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250407-gpiochip-set-rv-gpio-part1-v1-11-78399683ca38@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-17gpio: htc-egpio: use new line value setter callbacksBartosz Golaszewski
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> Link: https://lore.kernel.org/r/20250407-gpiochip-set-rv-gpio-part1-v1-10-78399683ca38@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-17gpio: htc-egpio: enable building with COMPILE_TEST=yBartosz Golaszewski
Extend the build coverage by allowing to build the module with COMPILE_TEST enabled. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250407-gpiochip-set-rv-gpio-part1-v1-9-78399683ca38@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-17gpio: gw-pld: use new line value setter callbacksBartosz Golaszewski
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> Link: https://lore.kernel.org/r/20250407-gpiochip-set-rv-gpio-part1-v1-8-78399683ca38@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-17gpio: graniterapids: use new line value setter callbacksBartosz Golaszewski
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> Link: https://lore.kernel.org/r/20250407-gpiochip-set-rv-gpio-part1-v1-7-78399683ca38@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-17gpio: f7188: use new line value setter callbacksBartosz Golaszewski
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> Link: https://lore.kernel.org/r/20250407-gpiochip-set-rv-gpio-part1-v1-6-78399683ca38@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-16gpio: exar: use new line value setter callbacksBartosz Golaszewski
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> Link: https://lore.kernel.org/r/20250407-gpiochip-set-rv-gpio-part1-v1-4-78399683ca38@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-16gpio: em: use new line value setter callbacksBartosz Golaszewski
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> Link: https://lore.kernel.org/r/20250407-gpiochip-set-rv-gpio-part1-v1-3-78399683ca38@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-16gpio: eic-sprd: use new line value setter callbacksBartosz Golaszewski
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> Link: https://lore.kernel.org/r/20250407-gpiochip-set-rv-gpio-part1-v1-2-78399683ca38@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-16gpio: dln2: use new line value setter callbacksBartosz Golaszewski
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> Link: https://lore.kernel.org/r/20250407-gpiochip-set-rv-gpio-part1-v1-1-78399683ca38@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-14gpio: GPIO_BLZP1600 should depend on ARCH_BLAIZEGeert Uytterhoeven
The Blaize BLZP1600 GPIO controller is only present on BLaize BLZP1600 SoCs. Hence add a dependency on ARCH_BLAIZE, to prevent asking the user about this driver when configuring a kernel without Blaize platform support. Fixes: 602ae04f56542d8e ("gpio: Enable Blaize BLZP1600 GPIO support") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Nikolaos Pasaloukos <nikolaos.pasaloukos@blaize.com> Link: https://lore.kernel.org/r/a75af4b623579a193b4a59350c063969aabb5b71.1744190524.git.geert+renesas@glider.be Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-14gpio: aggregator: Fix leak in gpio_aggregator_parse()Dan Carpenter
Call gpio_aggregator_free_lines() before returning on this error path. Fixes: 83c8e3df642f ("gpio: aggregator: expose aggregator created via legacy sysfs to configfs") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Acked-by: Koichiro Den <koichiro.den@canonical.com> Link: https://lore.kernel.org/r/e023bfe52509ce1bef6209ec7c47e99279c551dd.1744452787.git.dan.carpenter@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-14gpio: aggregator: Fix error code in gpio_aggregator_activate()Dan Carpenter
Propagate the error code if gpio_aggregator_make_device_sw_node() fails. Don't return success. Fixes: 86f162e73d2d ("gpio: aggregator: introduce basic configfs interface") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Acked-by: Koichiro Den <koichiro.den@canonical.com> Link: https://lore.kernel.org/r/79b804a0769a434698616bebedacc0e5d5605fdc.1744452787.git.dan.carpenter@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-14gpio: aggregator: Return an error if there are no GPIOs in ↵Dan Carpenter
gpio_aggregator_parse() The error handling in gpio_aggregator_parse() was re-written. It now returns success if there are no GPIOs. Restore the previous behavior and return -EINVAL instead. Fixes: 83c8e3df642f ("gpio: aggregator: expose aggregator created via legacy sysfs to configfs") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Acked-by: Koichiro Den <koichiro.den@canonical.com> Link: https://lore.kernel.org/r/9dcd5fda7a3819e896d9eee4156e7c46c9a64595.1744452787.git.dan.carpenter@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-14gpio: aggregator: Fix gpio_aggregator_line_alloc() checkingDan Carpenter
The gpio_aggregator_line_alloc() function returns error pointers, but the callers check for NULL. Update the error checking in the callers. Fixes: 83c8e3df642f ("gpio: aggregator: expose aggregator created via legacy sysfs to configfs") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Acked-by: Koichiro Den <koichiro.den@canonical.com> Link: https://lore.kernel.org/r/cc71d8cf6e9bb4bb8cd9ae5050100081891d9345.1744452787.git.dan.carpenter@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-14gpio: aggregator: fix "_sysfs" prefix check in gpio_aggregator_make_group()Dan Carpenter
This code is intended to reject strings that start with "_sysfs" but the strcmp() limit is wrong so checks the whole string instead of the prefix. Fixes: 83c8e3df642f ("gpio: aggregator: expose aggregator created via legacy sysfs to configfs") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Koichiro Den <koichiro.den@canonical.com> Link: https://lore.kernel.org/r/30210ed77b40b4b6629de659cb56b9ec7832c447.1744452787.git.dan.carpenter@linaro.org Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
2025-04-14gpiolib: Allow to use setters with return value for output-only gpiosMathieu Dubois-Briand
The gpiod_direction_output_raw_commit() function checks if any setter callback is present before doing anything. As the new GPIO setters with return values were introduced, make this check also succeed if one is present. Fixes: 98ce1eb1fd87 ("gpiolib: introduce gpio_chip setters that return values") Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Link: https://lore.kernel.org/r/20250411-mdb-gpiolib-setters-fix-v2-1-9611280d8822@bootlin.com Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>