diff mbox series

[2/7] ASoC: dapm: Don't fail creating new DAPM control on NULL pinctrl

Message ID 20180828133508.13012-2-ckeepax@opensource.cirrus.com (mailing list archive)
State Accepted
Commit a5cd7e9cf587f51a84b86c828b4e1c7b392f448e
Headers show
Series [1/7] ASoC: dapm: Remove clock framework ifdefs | expand

Commit Message

Charles Keepax Aug. 28, 2018, 1:35 p.m. UTC
devm_pinctrl_get will only return NULL in the case that pinctrl
is not built into the kernel and all the pinctrl functions used
by the DAPM core are appropriately stubbed for that case. There
is no need to error out of snd_soc_dapm_new_control_unlocked
if pinctrl isn't built into the kernel, so change the
IS_ERR_OR_NULL to just an IS_ERR.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
 sound/soc/soc-dapm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 78ab6965af55..d7be3981f026 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3487,7 +3487,7 @@  snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm,
 		break;
 	case snd_soc_dapm_pinctrl:
 		w->pinctrl = devm_pinctrl_get(dapm->dev);
-		if (IS_ERR_OR_NULL(w->pinctrl)) {
+		if (IS_ERR(w->pinctrl)) {
 			ret = PTR_ERR(w->pinctrl);
 			if (ret == -EPROBE_DEFER)
 				return ERR_PTR(ret);