Skip to content

Commit c1a77ba

Browse files
andy-shevbroonie
authored andcommitted
ASoC: ti: davinci-mcasp: Remove unnecessary conditional
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>
1 parent 4db3207 commit c1a77ba

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

sound/soc/ti/davinci-mcasp.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,12 +1870,10 @@ static int mcasp_reparent_fck(struct platform_device *pdev)
18701870
static bool davinci_mcasp_have_gpiochip(struct davinci_mcasp *mcasp)
18711871
{
18721872
#ifdef CONFIG_OF_GPIO
1873-
if (mcasp->dev->of_node &&
1874-
of_property_read_bool(mcasp->dev->of_node, "gpio-controller"))
1875-
return true;
1876-
#endif
1877-
1873+
return of_property_read_bool(mcasp->dev->of_node, "gpio-controller");
1874+
#else
18781875
return false;
1876+
#endif
18791877
}
18801878

18811879
static int davinci_mcasp_get_config(struct davinci_mcasp *mcasp,

0 commit comments

Comments
 (0)