]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpiolib: of: Only compile in MT2701 quirk when it is needed.
authorDaniel Palmer <daniel@thingy.jp>
Sun, 14 Dec 2025 03:40:45 +0000 (12:40 +0900)
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Wed, 17 Dec 2025 09:24:41 +0000 (10:24 +0100)
The compiler cannot workout if this is actually needed or not
so machines that will never need this code also get it.

For example:
m68k-linux-gnu-nm vmlinux | grep mt27
00135742 t of_find_mt2701_gpio

Add some ugly ifdef'ery to get rid of it.

Signed-off-by: Daniel Palmer <daniel@thingy.jp>
Link: https://lore.kernel.org/r/20251214034045.4029590-1-daniel@thingy.jp
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
drivers/gpio/gpiolib-of.c

index 8657379e9165c3184e5ca4e2abe64f6ffd80b1df..ef1ac68b94b78f09e768cc740e893632b8817505 100644 (file)
@@ -634,6 +634,7 @@ static struct gpio_desc *of_find_gpio_rename(struct device_node *np,
        return ERR_PTR(-ENOENT);
 }
 
+#if IS_ENABLED(CONFIG_SND_SOC_MT2701_CS42448)
 static struct gpio_desc *of_find_mt2701_gpio(struct device_node *np,
                                             const char *con_id,
                                             unsigned int idx,
@@ -665,6 +666,7 @@ static struct gpio_desc *of_find_mt2701_gpio(struct device_node *np,
 
        return desc;
 }
+#endif
 
 /*
  * Trigger sources are special, they allow us to use any GPIO as a LED trigger
@@ -699,7 +701,9 @@ typedef struct gpio_desc *(*of_find_gpio_quirk)(struct device_node *np,
                                                enum of_gpio_flags *of_flags);
 static const of_find_gpio_quirk of_find_gpio_quirks[] = {
        of_find_gpio_rename,
+#if IS_ENABLED(CONFIG_SND_SOC_MT2701_CS42448)
        of_find_mt2701_gpio,
+#endif
        of_find_trigger_gpio,
        NULL
 };