瀏覽代碼

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 <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Takashi Iwai 8 年之前
父節點
當前提交
befff4fbc2
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      sound/soc/davinci/davinci-mcasp.c

+ 2 - 1
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,