ASoC: ti: davinci-mcasp: Remove unnecessary conditional
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 2 Dec 2021 20:56:12 +0000 (22:56 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 6 Dec 2021 13:49:29 +0000 (13:49 +0000)
Instead of double validating of_node, return value of
the boolean property directly.

We can't remove ifdeffery, because in OF_GPIO=n cases
it might bring unwanted surprises.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/20211202205612.76216-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/ti/davinci-mcasp.c

index 81c1ccec59040ca31f582a4c4748271b2a907f4c..3e105caac95eeb0f32bf35075fdebacb35284897 100644 (file)
@@ -1870,12 +1870,10 @@ err1:
 static bool davinci_mcasp_have_gpiochip(struct davinci_mcasp *mcasp)
 {
 #ifdef CONFIG_OF_GPIO
-       if (mcasp->dev->of_node &&
-           of_property_read_bool(mcasp->dev->of_node, "gpio-controller"))
-               return true;
-#endif
-
+       return of_property_read_bool(mcasp->dev->of_node, "gpio-controller");
+#else
        return false;
+#endif
 }
 
 static int davinci_mcasp_get_config(struct davinci_mcasp *mcasp,