]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ASoC: sun4i-codec: Remove unneeded gpiod NULL check
authorFabio Estevam <fabio.estevam@nxp.com>
Sun, 16 Jul 2017 21:11:06 +0000 (18:11 -0300)
committerMark Brown <broonie@kernel.org>
Mon, 17 Jul 2017 14:40:05 +0000 (15:40 +0100)
The gpiod API checks for NULL descriptors, so there is no need to
duplicate the check in the driver.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sunxi/sun4i-codec.c

index 150069987c0c3e5fd463636be8e46a832834cb1b..4c37231f254b53adf675440eee5637a890efaa38 100644 (file)
@@ -1171,9 +1171,8 @@ static int sun4i_codec_spk_event(struct snd_soc_dapm_widget *w,
 {
        struct sun4i_codec *scodec = snd_soc_card_get_drvdata(w->dapm->card);
 
-       if (scodec->gpio_pa)
-               gpiod_set_value_cansleep(scodec->gpio_pa,
-                                        !!SND_SOC_DAPM_EVENT_ON(event));
+       gpiod_set_value_cansleep(scodec->gpio_pa,
+                                !!SND_SOC_DAPM_EVENT_ON(event));
 
        return 0;
 }