ASoC: omap: Use WARN_ON() instead of BUG_ON()
authorTakashi Iwai <tiwai@suse.de>
Tue, 5 Nov 2013 17:40:02 +0000 (18:40 +0100)
committerMark Brown <broonie@linaro.org>
Thu, 7 Nov 2013 19:55:15 +0000 (19:55 +0000)
Use WARN_ON() and handle the error cases accordingly.

Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/omap/n810.c

index 5e8d640d314f272f2569fbe1ba40b20916f5aeb4..6d216cb6c19bd2ba92c4d326d2ee6761dc2e5ef3 100644 (file)
@@ -344,8 +344,11 @@ static int __init n810_soc_init(void)
        clk_set_parent(sys_clkout2_src, func96m_clk);
        clk_set_rate(sys_clkout2, 12000000);
 
-       BUG_ON((gpio_request(N810_HEADSET_AMP_GPIO, "hs_amp") < 0) ||
-              (gpio_request(N810_SPEAKER_AMP_GPIO, "spk_amp") < 0));
+       if (WARN_ON((gpio_request(N810_HEADSET_AMP_GPIO, "hs_amp") < 0) ||
+                   (gpio_request(N810_SPEAKER_AMP_GPIO, "spk_amp") < 0))) {
+               err = -EINVAL;
+               goto err4;
+       }
 
        gpio_direction_output(N810_HEADSET_AMP_GPIO, 0);
        gpio_direction_output(N810_SPEAKER_AMP_GPIO, 0);