]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpiolib: Move GPIO_DYNAMIC_* constants to its only user
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Sat, 31 May 2025 19:55:44 +0000 (22:55 +0300)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 10 Jun 2025 08:08:34 +0000 (10:08 +0200)
There is no need to export GPIO_DYNAMIC_* constants, especially via
legacy header which is subject to remove. Move the mentioned constants
to its only user, i.e. gpiolib.c.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250531195801.3632110-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpiolib.c
include/linux/gpio.h

index fdafa0df1b43241c9baf7cbd838856db25174fba..5b0b4fc975435290a03410f1e33fea28dd6fea08 100644 (file)
@@ -74,6 +74,19 @@ static const struct bus_type gpio_bus_type = {
        .match = gpio_bus_match,
 };
 
+/*
+ * At the end we want all GPIOs to be dynamically allocated from 0.
+ * However, some legacy drivers still perform fixed allocation.
+ * Until they are all fixed, leave 0-512 space for them.
+ */
+#define GPIO_DYNAMIC_BASE      512
+/*
+ * Define the maximum of the possible GPIO in the global numberspace.
+ * While the GPIO base and numbers are positive, we limit it with signed
+ * maximum as a lot of code is using negative values for special cases.
+ */
+#define GPIO_DYNAMIC_MAX       INT_MAX
+
 /*
  * Number of GPIOs to use for the fast path in set array
  */
index 8697ab81789812633d25c9f9346c195b6be7a208..ff99ed76fdc330ce6f67c4665db625cda37a37df 100644 (file)
@@ -45,19 +45,6 @@ static inline bool gpio_is_valid(int number)
  * extra memory (for code and for per-GPIO table entries).
  */
 
-/*
- * At the end we want all GPIOs to be dynamically allocated from 0.
- * However, some legacy drivers still perform fixed allocation.
- * Until they are all fixed, leave 0-512 space for them.
- */
-#define GPIO_DYNAMIC_BASE      512
-/*
- * Define the maximum of the possible GPIO in the global numberspace.
- * While the GPIO base and numbers are positive, we limit it with signed
- * maximum as a lot of code is using negative values for special cases.
- */
-#define GPIO_DYNAMIC_MAX       INT_MAX
-
 /* Always use the library code for GPIO management calls,
  * or when sleeping may be involved.
  */