aboutsummaryrefslogtreecommitdiffstats
path: root/sound/drivers/opl3/opl3_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/drivers/opl3/opl3_lib.c')
-rw-r--r--sound/drivers/opl3/opl3_lib.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/drivers/opl3/opl3_lib.c b/sound/drivers/opl3/opl3_lib.c
index ebe4359047cb..780582340fef 100644
--- a/sound/drivers/opl3/opl3_lib.c
+++ b/sound/drivers/opl3/opl3_lib.c
@@ -139,7 +139,8 @@ static int snd_opl3_detect(struct snd_opl3 * opl3)
139 * If we had an OPL4 chip, opl3->hardware would have been set 139 * If we had an OPL4 chip, opl3->hardware would have been set
140 * by the OPL4 driver; so we can assume OPL3 here. 140 * by the OPL4 driver; so we can assume OPL3 here.
141 */ 141 */
142 snd_assert(opl3->r_port != 0, return -ENODEV); 142 if (snd_BUG_ON(!opl3->r_port))
143 return -ENODEV;
143 opl3->hardware = OPL3_HW_OPL3; 144 opl3->hardware = OPL3_HW_OPL3;
144 } 145 }
145 return 0; 146 return 0;
@@ -324,7 +325,8 @@ EXPORT_SYMBOL(snd_opl3_interrupt);
324 325
325static int snd_opl3_free(struct snd_opl3 *opl3) 326static int snd_opl3_free(struct snd_opl3 *opl3)
326{ 327{
327 snd_assert(opl3 != NULL, return -ENXIO); 328 if (snd_BUG_ON(!opl3))
329 return -ENXIO;
328 if (opl3->private_free) 330 if (opl3->private_free)
329 opl3->private_free(opl3); 331 opl3->private_free(opl3);
330 snd_opl3_clear_patches(opl3); 332 snd_opl3_clear_patches(opl3);