diff mbox series

[v1,1/2] gpiolib: Move gpiochip_get_data() upper in the code

Message ID 20230321135332.73190-1-andriy.shevchenko@linux.intel.com
State Accepted
Commit 8deb779d36cb86c1c1c37d767317f5899b32fc76
Headers show
Series [v1,1/2] gpiolib: Move gpiochip_get_data() upper in the code | expand

Commit Message

Andy Shevchenko March 21, 2023, 1:53 p.m. UTC
Move gpiochip_get_data() upper in the code as a preparation
for further refactoring.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpiolib.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

Comments

Bartosz Golaszewski April 3, 2023, 3:47 p.m. UTC | #1
On Tue, Mar 21, 2023 at 2:52 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> Move gpiochip_get_data() upper in the code as a preparation
> for further refactoring.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/gpio/gpiolib.c | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index 62114d69bcea..2bfc474d99c3 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -681,6 +681,19 @@ static void gpiochip_setup_devs(void)
>         }
>  }
>
> +/**
> + * gpiochip_get_data() - get per-subdriver data for the chip
> + * @gc: GPIO chip
> + *
> + * Returns:
> + * The per-subdriver data for the chip.
> + */
> +void *gpiochip_get_data(struct gpio_chip *gc)
> +{
> +       return gc->gpiodev->data;
> +}
> +EXPORT_SYMBOL_GPL(gpiochip_get_data);
> +
>  int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,
>                                struct lock_class_key *lock_key,
>                                struct lock_class_key *request_key)
> @@ -939,19 +952,6 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,
>  }
>  EXPORT_SYMBOL_GPL(gpiochip_add_data_with_key);
>
> -/**
> - * gpiochip_get_data() - get per-subdriver data for the chip
> - * @gc: GPIO chip
> - *
> - * Returns:
> - * The per-subdriver data for the chip.
> - */
> -void *gpiochip_get_data(struct gpio_chip *gc)
> -{
> -       return gc->gpiodev->data;
> -}
> -EXPORT_SYMBOL_GPL(gpiochip_get_data);
> -
>  /**
>   * gpiochip_remove() - unregister a gpio_chip
>   * @gc: the chip to unregister
> --
> 2.40.0.1.gaa8946217a0b
>

Both applied, thanks!

Bart
diff mbox series

Patch

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 62114d69bcea..2bfc474d99c3 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -681,6 +681,19 @@  static void gpiochip_setup_devs(void)
 	}
 }
 
+/**
+ * gpiochip_get_data() - get per-subdriver data for the chip
+ * @gc: GPIO chip
+ *
+ * Returns:
+ * The per-subdriver data for the chip.
+ */
+void *gpiochip_get_data(struct gpio_chip *gc)
+{
+	return gc->gpiodev->data;
+}
+EXPORT_SYMBOL_GPL(gpiochip_get_data);
+
 int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,
 			       struct lock_class_key *lock_key,
 			       struct lock_class_key *request_key)
@@ -939,19 +952,6 @@  int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,
 }
 EXPORT_SYMBOL_GPL(gpiochip_add_data_with_key);
 
-/**
- * gpiochip_get_data() - get per-subdriver data for the chip
- * @gc: GPIO chip
- *
- * Returns:
- * The per-subdriver data for the chip.
- */
-void *gpiochip_get_data(struct gpio_chip *gc)
-{
-	return gc->gpiodev->data;
-}
-EXPORT_SYMBOL_GPL(gpiochip_get_data);
-
 /**
  * gpiochip_remove() - unregister a gpio_chip
  * @gc: the chip to unregister