]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
MIPS: txx9: gpio: use new line value setter callbacks
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 7 Apr 2025 07:25:10 +0000 (09:25 +0200)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Sun, 27 Apr 2025 07:21:21 +0000 (09:21 +0200)
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the drivers to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/kernel/gpio_txx9.c
arch/mips/txx9/generic/setup.c

index 8c083612df9d00a88257ef93af8c2d4a7c315ede..027fb57d0d79adf0f203894fd9a72a762f313c4e 100644 (file)
@@ -32,14 +32,16 @@ static void txx9_gpio_set_raw(unsigned int offset, int value)
        __raw_writel(val, &txx9_pioptr->dout);
 }
 
-static void txx9_gpio_set(struct gpio_chip *chip, unsigned int offset,
-                         int value)
+static int txx9_gpio_set(struct gpio_chip *chip, unsigned int offset,
+                        int value)
 {
        unsigned long flags;
        spin_lock_irqsave(&txx9_gpio_lock, flags);
        txx9_gpio_set_raw(offset, value);
        mmiowb();
        spin_unlock_irqrestore(&txx9_gpio_lock, flags);
+
+       return 0;
 }
 
 static int txx9_gpio_dir_in(struct gpio_chip *chip, unsigned int offset)
@@ -68,7 +70,7 @@ static int txx9_gpio_dir_out(struct gpio_chip *chip, unsigned int offset,
 
 static struct gpio_chip txx9_gpio_chip = {
        .get = txx9_gpio_get,
-       .set = txx9_gpio_set,
+       .set_rv = txx9_gpio_set,
        .direction_input = txx9_gpio_dir_in,
        .direction_output = txx9_gpio_dir_out,
        .label = "TXx9",
index 1e67fecd466ec060c3dcaa22da2a5ac074f1081a..0586ca7668b42eaa269c1f3e772eea3fdad694d1 100644 (file)
@@ -603,8 +603,8 @@ static int txx9_iocled_get(struct gpio_chip *chip, unsigned int offset)
        return !!(data->cur_val & (1 << offset));
 }
 
-static void txx9_iocled_set(struct gpio_chip *chip, unsigned int offset,
-                           int value)
+static int txx9_iocled_set(struct gpio_chip *chip, unsigned int offset,
+                          int value)
 {
        struct txx9_iocled_data *data = gpiochip_get_data(chip);
        unsigned long flags;
@@ -616,6 +616,8 @@ static void txx9_iocled_set(struct gpio_chip *chip, unsigned int offset,
        writeb(data->cur_val, data->mmioaddr);
        mmiowb();
        spin_unlock_irqrestore(&txx9_iocled_lock, flags);
+
+       return 0;
 }
 
 static int txx9_iocled_dir_in(struct gpio_chip *chip, unsigned int offset)
@@ -653,7 +655,7 @@ void __init txx9_iocled_init(unsigned long baseaddr,
        if (!iocled->mmioaddr)
                goto out_free;
        iocled->chip.get = txx9_iocled_get;
-       iocled->chip.set = txx9_iocled_set;
+       iocled->chip.set_rv = txx9_iocled_set;
        iocled->chip.direction_input = txx9_iocled_dir_in;
        iocled->chip.direction_output = txx9_iocled_dir_out;
        iocled->chip.label = "iocled";