[openwrt/openwrt] package: gpio-nct5104d: adapt to kernel 6.18

LEDE Commits lede-commits at lists.infradead.org
Tue Dec 30 01:44:13 PST 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/ed836b1a9d86777cc37fa5b3765aea8b5addd876

commit ed836b1a9d86777cc37fa5b3765aea8b5addd876
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Thu Dec 18 12:51:33 2025 -0500

    package: gpio-nct5104d: adapt to kernel 6.18
    
    - Changing return type from void to int
    - Returning error code instead of void on superio_enter() failure
    - Returning 0 on success
    
    Signed-off-by: John Audia <therealgraysky at proton.me>
    Link: https://github.com/openwrt/openwrt/pull/21218
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/kernel/gpio-nct5104d/src/gpio-nct5104d.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/package/kernel/gpio-nct5104d/src/gpio-nct5104d.c b/package/kernel/gpio-nct5104d/src/gpio-nct5104d.c
index ffeab29eda..6dce1c2960 100644
--- a/package/kernel/gpio-nct5104d/src/gpio-nct5104d.c
+++ b/package/kernel/gpio-nct5104d/src/gpio-nct5104d.c
@@ -124,8 +124,11 @@ static int nct5104d_gpio_direction_in(struct gpio_chip *chip, unsigned offset);
 static int nct5104d_gpio_get(struct gpio_chip *chip, unsigned offset);
 static int nct5104d_gpio_direction_out(struct gpio_chip *chip,
 				     unsigned offset, int value);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,17,0)
+static int nct5104d_gpio_set(struct gpio_chip *chip, unsigned offset, int value);
+#else
 static void nct5104d_gpio_set(struct gpio_chip *chip, unsigned offset, int value);
-
+#endif
 #define NCT5104D_GPIO_BANK(_base, _ngpio, _regbase)			\
 	{								\
 		.chip = {						\
@@ -219,7 +222,11 @@ static int nct5104d_gpio_direction_out(struct gpio_chip *chip,
 	return 0;
 }
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,17,0)
+static int nct5104d_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+#else
 static void nct5104d_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+#endif
 {
 	int err;
 	struct nct5104d_gpio_bank *bank = gpiochip_get_data(chip);
@@ -228,7 +235,11 @@ static void nct5104d_gpio_set(struct gpio_chip *chip, unsigned offset, int value
 
 	err = superio_enter(sio->addr);
 	if (err)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,17,0)
+		return err;
+#else
 		return;
+#endif
 	superio_select(sio->addr, SIO_LD_GPIO);
 
 	data_out = superio_inb(sio->addr, gpio_data(bank->regbase));
@@ -239,6 +250,10 @@ static void nct5104d_gpio_set(struct gpio_chip *chip, unsigned offset, int value
 	superio_outb(sio->addr, gpio_data(bank->regbase), data_out);
 
 	superio_exit(sio->addr);
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,17,0)
+	return 0;
+#endif
 }
 
 /*




More information about the lede-commits mailing list