pinctrl: renesas: use new pinctrl GPIO helpers
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 3 Oct 2023 07:54:07 +0000 (09:54 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Sat, 4 Nov 2023 09:23:19 +0000 (10:23 +0100)
Replace the pinctrl helpers taking the global GPIO number as argument
with the improved variants that instead take a pointer to the GPIO chip
and the controller-relative offset.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/renesas/gpio.c
drivers/pinctrl/renesas/pinctrl-rzg2l.c
drivers/pinctrl/renesas/pinctrl-rzv2m.c

index 5758daf94fe2e867282a4c35c0b7196fb11f6734..e7771a57e6d11318f9317cce76b1fbf1d23e4829 100644 (file)
@@ -135,12 +135,12 @@ static int gpio_pin_request(struct gpio_chip *gc, unsigned offset)
        if (idx < 0 || pfc->info->pins[idx].enum_id == 0)
                return -EINVAL;
 
-       return pinctrl_gpio_request(gc->base + offset);
+       return pinctrl_gpio_request_new(gc, offset);
 }
 
 static void gpio_pin_free(struct gpio_chip *gc, unsigned offset)
 {
-       return pinctrl_gpio_free(gc->base + offset);
+       return pinctrl_gpio_free_new(gc, offset);
 }
 
 static void gpio_pin_set_value(struct sh_pfc_chip *chip, unsigned offset,
@@ -164,7 +164,7 @@ static void gpio_pin_set_value(struct sh_pfc_chip *chip, unsigned offset,
 
 static int gpio_pin_direction_input(struct gpio_chip *gc, unsigned offset)
 {
-       return pinctrl_gpio_direction_input(gc->base + offset);
+       return pinctrl_gpio_direction_input_new(gc, offset);
 }
 
 static int gpio_pin_direction_output(struct gpio_chip *gc, unsigned offset,
@@ -172,7 +172,7 @@ static int gpio_pin_direction_output(struct gpio_chip *gc, unsigned offset,
 {
        gpio_pin_set_value(gpiochip_get_data(gc), offset, value);
 
-       return pinctrl_gpio_direction_output(gc->base + offset);
+       return pinctrl_gpio_direction_output_new(gc, offset);
 }
 
 static int gpio_pin_get(struct gpio_chip *gc, unsigned offset)
index c7c6d912a975fca21dbdfd2ec6005427d71088a4..22d4ab7d228c6bd0faf6b643092ebe589d9b5ea6 100644 (file)
@@ -1056,7 +1056,7 @@ static int rzg2l_gpio_request(struct gpio_chip *chip, unsigned int offset)
        if (ret)
                return ret;
 
-       ret = pinctrl_gpio_request(chip->base + offset);
+       ret = pinctrl_gpio_request_new(chip, offset);
        if (ret)
                return ret;
 
@@ -1181,7 +1181,7 @@ static void rzg2l_gpio_free(struct gpio_chip *chip, unsigned int offset)
 {
        unsigned int virq;
 
-       pinctrl_gpio_free(chip->base + offset);
+       pinctrl_gpio_free_new(chip, offset);
 
        virq = irq_find_mapping(chip->irq.domain, offset);
        if (virq)
index 52aeafaba4b697a0d8c719f2bc80697ad0d856d5..3d29c77a5aadfd82d38446371e12c4529a4e291a 100644 (file)
@@ -754,7 +754,7 @@ static int rzv2m_gpio_request(struct gpio_chip *chip, unsigned int offset)
        u8 bit = RZV2M_PIN_ID_TO_PIN(offset);
        int ret;
 
-       ret = pinctrl_gpio_request(chip->base + offset);
+       ret = pinctrl_gpio_request_new(chip, offset);
        if (ret)
                return ret;
 
@@ -832,7 +832,7 @@ static int rzv2m_gpio_get(struct gpio_chip *chip, unsigned int offset)
 
 static void rzv2m_gpio_free(struct gpio_chip *chip, unsigned int offset)
 {
-       pinctrl_gpio_free(chip->base + offset);
+       pinctrl_gpio_free_new(chip, offset);
 
        /*
         * Set the GPIO as an input to ensure that the next GPIO request won't