[PATCH] ASoC: davinci-mcasp: remove unneeded #ifdef

Bartosz Golaszewski posted 1 patch 2 weeks ago
sound/soc/ti/davinci-mcasp.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
[PATCH] ASoC: davinci-mcasp: remove unneeded #ifdef
Posted by Bartosz Golaszewski 2 weeks ago
The enablement of the CONFIG_OF_GPIO switch has nothing to do with the
"gpio-controller" property which may as well come from software nodes
and GPIOLIB can still be enabled separately.

This driver does not call any symbols from gpiolib-of.h so has no need
to check this option at all. Just use the generic device property
accessor.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 sound/soc/ti/davinci-mcasp.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
index 621a9d5f9377..db6913c05378 100644
--- a/sound/soc/ti/davinci-mcasp.c
+++ b/sound/soc/ti/davinci-mcasp.c
@@ -25,6 +25,7 @@
 #include <linux/math64.h>
 #include <linux/bitmap.h>
 #include <linux/gpio/driver.h>
+#include <linux/property.h>
 
 #include <sound/asoundef.h>
 #include <sound/core.h>
@@ -1875,11 +1876,7 @@ static int mcasp_reparent_fck(struct platform_device *pdev)
 
 static bool davinci_mcasp_have_gpiochip(struct davinci_mcasp *mcasp)
 {
-#ifdef CONFIG_OF_GPIO
-	return of_property_read_bool(mcasp->dev->of_node, "gpio-controller");
-#else
-	return false;
-#endif
+	return device_property_present(mcasp->dev, "gpio-controller");
 }
 
 static int davinci_mcasp_get_config(struct davinci_mcasp *mcasp,
-- 
2.51.0
Re: [PATCH] ASoC: davinci-mcasp: remove unneeded #ifdef
Posted by Mark Brown 4 days ago
On Fri, 05 Dec 2025 10:05:34 +0100, Bartosz Golaszewski wrote:
> The enablement of the CONFIG_OF_GPIO switch has nothing to do with the
> "gpio-controller" property which may as well come from software nodes
> and GPIOLIB can still be enabled separately.
> 
> This driver does not call any symbols from gpiolib-of.h so has no need
> to check this option at all. Just use the generic device property
> accessor.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: davinci-mcasp: remove unneeded #ifdef
      commit: 0c1db366642172e85ee98eeed7c127b80eb609a3

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark