gpio: xgene-sb: use generic GPIO chip register read and write APIs
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 10 Sep 2025 07:12:42 +0000 (09:12 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Fri, 12 Sep 2025 07:22:44 +0000 (09:22 +0200)
The conversion to using the modernized generic GPIO chip API was
incomplete without also converting the direct calls to write/read_reg()
callbacks. Use the provided wrappers from linux/gpio/generic.h.

Fixes: 38d98a822c14 ("gpio: xgene-sb: use new generic GPIO chip API")
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250910-gpio-mmio-gpio-conv-part4-v2-6-f3d1a4c57124@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-xgene-sb.c

index 28ee3f7..661259f 100644 (file)
@@ -63,14 +63,15 @@ struct xgene_gpio_sb {
 static void xgene_gpio_set_bit(struct gpio_chip *gc,
                                void __iomem *reg, u32 gpio, int val)
 {
+       struct gpio_generic_chip *chip = to_gpio_generic_chip(gc);
        u32 data;
 
-       data = gc->read_reg(reg);
+       data = gpio_generic_read_reg(chip, reg);
        if (val)
                data |= GPIO_MASK(gpio);
        else
                data &= ~GPIO_MASK(gpio);
-       gc->write_reg(reg, data);
+       gpio_generic_write_reg(chip, reg, data);
 }
 
 static int xgene_gpio_sb_irq_set_type(struct irq_data *d, unsigned int type)