From: Takashi Iwai Date: Thu, 7 Sep 2017 08:59:17 +0000 (+0200) Subject: ASoC: davinci: Kill BUG_ON() usage X-Git-Tag: v4.15-rc1~118^2~1^2~7^4~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=befff4fbc27e19b14b343eb4a65d8f75d38b6230;p=thirdparty%2Fkernel%2Flinux.git ASoC: davinci: Kill BUG_ON() usage Don't use BUG_ON() for a non-critical sanity check on production systems. This patch replaces with a softer WARN_ON() and an error path. Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown --- diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index 23b0da7df1f28..40be08cecea49 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c @@ -1721,7 +1721,8 @@ static int davinci_mcasp_get_dma_type(struct davinci_mcasp *mcasp) PTR_ERR(chan)); return PTR_ERR(chan); } - BUG_ON(!chan->device || !chan->device->dev); + if (WARN_ON(!chan->device || !chan->device->dev)) + return -EINVAL; if (chan->device->dev->of_node) ret = of_property_read_string(chan->device->dev->of_node,