diff --git a/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c b/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c index 6ed1e82a5a..d8b5603a58 100644 --- a/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c +++ b/target/linux/ath79/files/drivers/gpio/gpio-latch-mikrotik.c @@ -12,6 +12,7 @@ #include #include #include +#include #define GPIO_LATCH_DRIVER_NAME "gpio-latch-mikrotik" #define GPIO_LATCH_LINES 9 @@ -61,7 +62,11 @@ gpio_latch_get(struct gpio_chip *gc, unsigned offset) return ret; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,17,0) +static int +#else static void +#endif gpio_latch_set(struct gpio_chip *gc, unsigned offset, int value) { struct gpio_latch_chip *glc = gpiochip_get_data(gc); @@ -76,6 +81,9 @@ gpio_latch_set(struct gpio_chip *gc, unsigned offset, int value) gpio_latch_lock(glc, enable_latch); gpiod_set_raw_value_cansleep(glc->gpios[offset], value); gpio_latch_unlock(glc, disable_latch); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,17,0) + return 0; +#endif } static int diff --git a/target/linux/ath79/files/drivers/gpio/gpio-rb4xx.c b/target/linux/ath79/files/drivers/gpio/gpio-rb4xx.c index 299dc7d0a1..ccb46f512f 100644 --- a/target/linux/ath79/files/drivers/gpio/gpio-rb4xx.c +++ b/target/linux/ath79/files/drivers/gpio/gpio-rb4xx.c @@ -18,6 +18,7 @@ #include #include #include +#include #include @@ -93,10 +94,18 @@ static int rb4xx_gpio_get(struct gpio_chip *chip, unsigned int offset) return ret; } -static void rb4xx_gpio_set(struct gpio_chip *chip, unsigned int offset, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,17,0) +static int +#else +static void +#endif +rb4xx_gpio_set(struct gpio_chip *chip, unsigned int offset, int value) { rb4xx_gpio_cpld_set(gpiochip_get_data(chip), offset, value); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,17,0) + return 0; +#endif } static int rb4xx_gpio_probe(struct platform_device *pdev) diff --git a/target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c b/target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c index 9e98d6a55e..8b30542c12 100644 --- a/target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c +++ b/target/linux/ath79/files/drivers/gpio/gpio-rb91x-key.c @@ -20,6 +20,7 @@ #include #include #include +#include #define GPIO_RB91X_KEY_DRIVER_NAME "gpio-rb91x-key" @@ -88,7 +89,12 @@ static int gpio_rb91x_key_direction_input(struct gpio_chip *gc, unsigned offset) } } -static void gpio_rb91x_key_set(struct gpio_chip *gc, unsigned offset, int value) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,17,0) +static int +#else +static void +#endif +gpio_rb91x_key_set(struct gpio_chip *gc, unsigned offset, int value) { struct gpio_rb91x_key *drvdata = gpiochip_get_data(gc); struct gpio_desc *gpio = drvdata->gpio; @@ -117,6 +123,9 @@ static void gpio_rb91x_key_set(struct gpio_chip *gc, unsigned offset, int value) } mutex_unlock(&drvdata->mutex); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,17,0) + return 0; +#endif } static int gpio_rb91x_key_direction_output(struct gpio_chip *gc, unsigned offset,