From: Daniel Palmer <daniel@thingy.jp>
To: linusw@kernel.org, brgl@kernel.org, linux-gpio@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Daniel Palmer <daniel@thingy.jp>
Subject: [PATCH] gpiolib: of: Only compile in MT2701 quirk when it is needed.
Date: Sun, 14 Dec 2025 12:40:45 +0900 [thread overview]
Message-ID: <20251214034045.4029590-1-daniel@thingy.jp> (raw)
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>
---
drivers/gpio/gpiolib-of.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index 8657379e9165..ef1ac68b94b7 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -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
};
--
2.51.0
next reply other threads:[~2025-12-14 3:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-14 3:40 Daniel Palmer [this message]
2025-12-17 9:26 ` Bartosz Golaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251214034045.4029590-1-daniel@thingy.jp \
--to=daniel@thingy.jp \
--cc=brgl@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®