[PATCH v2 2/4] pinctrl: mediatek: remove PINCONF conditional compilation

David Lechner <[email protected]>
Newsgroups gmane.comp.boot-loaders.u-boot
Message-ID <20260807-mtk-pinctrl-kconfig-cleanup-v2-2-509a8f833181__22602.7944519714$1786130249$gmane$org@baylibre.com>
Remove #if conditionals that checked if PINCONF was enabled. The Kconfig
now selects PINCONF, so it will always be enabled and we don't need the
checks anymore.

Signed-off-by: David Lechner <[email protected]>
---
 drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 13 -------------
 drivers/pinctrl/mediatek/pinctrl-mtk-common.h |  6 ------
 2 files changed, 19 deletions(-)

diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
index 01f67f09407..0b8234e167f 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
@@ -19,7 +19,6 @@
 
 #include "pinctrl-mtk-common.h"
 
-#if CONFIG_IS_ENABLED(PINCONF)
 /**
  * struct mtk_drive_desc - the structure that holds the information
  *			    of the driving current
@@ -45,7 +44,6 @@ static const struct mtk_drive_desc mtk_drive[] = {
 	[DRV_GRP3] = { 2, 8, 2, 2 },
 	[DRV_GRP4] = { 2, 16, 2, 1 },
 };
-#endif
 
 static const char *mtk_pinctrl_dummy_name = "_dummy";
 
@@ -223,7 +221,6 @@ static int mtk_hw_get_value(struct udevice *dev, int pin, int field,
 	return 0;
 }
 
-#if CONFIG_IS_ENABLED(PINCONF)
 static int mtk_get_pin_io_type(struct udevice *dev, int pin,
 			       struct mtk_io_type_desc *io_type)
 {
@@ -265,12 +262,6 @@ static int mtk_pinconf_get(struct udevice *dev, u32 pin, char *buf, size_t size)
 
 	return pos;
 }
-#else
-static int mtk_pinconf_get(struct udevice *dev, u32 pin, char *buf, size_t size)
-{
-	return 0;
-}
-#endif
 
 static int mtk_get_groups_count(struct udevice *dev)
 {
@@ -378,7 +369,6 @@ static int mtk_pinmux_group_set(struct udevice *dev,
 	return 0;
 }
 
-#if CONFIG_IS_ENABLED(PINCONF)
 static const struct pinconf_param mtk_conf_params[] = {
 	{ "bias-disable", PIN_CONFIG_BIAS_DISABLE, 0 },
 	{ "bias-pull-up", PIN_CONFIG_BIAS_PULL_UP, 1 },
@@ -757,7 +747,6 @@ int mtk_pinconf_get_pu_pd_rsel(struct udevice *dev, u32 pin, char *buf, size_t s
 
 	return pos + scnprintf(buf + pos, size - pos, " RSEL:%d", rsel);
 }
-#endif
 
 static int mtk_pinctrl_pinmux_property_set(struct udevice *dev, u32 pinmux_group)
 {
@@ -779,12 +768,10 @@ const struct pinctrl_ops mtk_pinctrl_ops = {
 	.get_function_name = mtk_get_function_name,
 	.pinmux_set = mtk_pinmux_set,
 	.pinmux_group_set = mtk_pinmux_group_set,
-#if CONFIG_IS_ENABLED(PINCONF)
 	.pinconf_num_params = ARRAY_SIZE(mtk_conf_params),
 	.pinconf_params = mtk_conf_params,
 	.pinconf_set = mtk_pinconf_set,
 	.pinconf_group_set = mtk_pinconf_group_set,
-#endif
 	.set_state = pinctrl_generic_set_state,
 	.pinmux_property_set = mtk_pinctrl_pinmux_property_set,
 };
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.h b/drivers/pinctrl/mediatek/pinctrl-mtk-common.h
index bd17964090a..1f97f3cd7b0 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.h
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.h
@@ -198,14 +198,12 @@ struct mtk_function_desc {
  */
 struct mtk_io_type_desc {
 	const char *name;
-#if CONFIG_IS_ENABLED(PINCONF)
 	/* Specific pinconfig operations */
 	int (*bias_set)(struct udevice *dev, u32 pin, bool disable,
 			bool pullup, u32 val);
 	int (*drive_set)(struct udevice *dev, u32 pin, u32 arg);
 	int (*input_enable)(struct udevice *dev, u32 pin, u32 arg);
 	int (*get_pinconf)(struct udevice *dev, u32 pin, char *buf, size_t size);
-#endif
 };
 
 /* struct mtk_pin_soc - the structure that holds SoC-specific data */
@@ -247,8 +245,6 @@ int mtk_pinctrl_common_bind(struct udevice *dev);
 int mtk_pinctrl_common_probe(struct udevice *dev,
 			     const struct mtk_pinctrl_soc *soc);
 
-#if CONFIG_IS_ENABLED(PINCONF)
-
 int mtk_pinconf_bias_set_pu_pd(struct udevice *dev, u32 pin, bool disable,
 			       bool pullup, u32 val);
 int mtk_pinconf_bias_set_pullen_pullsel(struct udevice *dev, u32 pin,
@@ -268,6 +264,4 @@ int mtk_pinconf_get_pu_pd(struct udevice *dev, u32 pin, char *buf, size_t size);
 int mtk_pinconf_get_pupd_r1_r0(struct udevice *dev, u32 pin, char *buf, size_t size);
 int mtk_pinconf_get_pu_pd_rsel(struct udevice *dev, u32 pin, char *buf, size_t size);
 
-#endif
-
 #endif /* __PINCTRL_MEDIATEK_H__ */

-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.