aboutsummaryrefslogtreecommitdiff
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-08-08 17:12:14 +0200
committerJaroslav Kysela <perex@perex.cz>2008-08-13 11:46:38 +0200
commitda3cec35dd3c31d8706db4bf379372ce70d92118 (patch)
tree9379edebb1c7abc7a7a92ce3be30a35b77d9aa1d /sound/pci/hda
parent622207dc31895b4e82c39100db8635d885c795e2 (diff)
ALSA: Kill snd_assert() in sound/pci/*
Kill snd_assert() in sound/pci/*, either removed or replaced with if () with snd_BUG_ON(). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r--sound/pci/hda/hda_codec.c21
-rw-r--r--sound/pci/hda/hda_generic.c3
-rw-r--r--sound/pci/hda/hda_intel.c3
-rw-r--r--sound/pci/hda/patch_realtek.c6
4 files changed, 22 insertions, 11 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index d2e1093f8e9..77fbcd4a69b 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -211,7 +211,8 @@ int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid,
unsigned int shift, num_elems, mask;
hda_nid_t prev_nid;
- snd_assert(conn_list && max_conns > 0, return -EINVAL);
+ if (snd_BUG_ON(!conn_list || max_conns <= 0))
+ return -EINVAL;
parm = snd_hda_param_read(codec, nid, AC_PAR_CONNLIST_LEN);
if (parm & AC_CLIST_LONG) {
@@ -407,8 +408,10 @@ int __devinit snd_hda_bus_new(struct snd_card *card,
.dev_free = snd_hda_bus_dev_free,
};
- snd_assert(temp, return -EINVAL);
- snd_assert(temp->ops.command && temp->ops.get_response, return -EINVAL);
+ if (snd_BUG_ON(!temp))
+ return -EINVAL;
+ if (snd_BUG_ON(!temp->ops.command || !temp->ops.get_response))
+ return -EINVAL;
if (busp)
*busp = NULL;
@@ -588,8 +591,10 @@ int __devinit snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr,
char component[13];
int err;
- snd_assert(bus, return -EINVAL);
- snd_assert(codec_addr <= HDA_MAX_CODEC_ADDRESS, return -EINVAL);
+ if (snd_BUG_ON(!bus))
+ return -EINVAL;
+ if (snd_BUG_ON(codec_addr > HDA_MAX_CODEC_ADDRESS))
+ return -EINVAL;
if (bus->caddr_tbl[codec_addr]) {
snd_printk(KERN_ERR "hda_codec: "
@@ -2236,11 +2241,13 @@ static int __devinit set_pcm_default_values(struct hda_codec *codec,
if (info->ops.close == NULL)
info->ops.close = hda_pcm_default_open_close;
if (info->ops.prepare == NULL) {
- snd_assert(info->nid, return -EINVAL);
+ if (snd_BUG_ON(!info->nid))
+ return -EINVAL;
info->ops.prepare = hda_pcm_default_prepare;
}
if (info->ops.cleanup == NULL) {
- snd_assert(info->nid, return -EINVAL);
+ if (snd_BUG_ON(!info->nid))
+ return -EINVAL;
info->ops.cleanup = hda_pcm_default_cleanup;
}
return 0;
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 59e4389c94a..0ca30894f7c 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -174,7 +174,8 @@ static int build_afg_tree(struct hda_codec *codec)
int i, nodes, err;
hda_nid_t nid;
- snd_assert(spec, return -EINVAL);
+ if (snd_BUG_ON(!spec))
+ return -EINVAL;
spec->def_amp_out_caps = snd_hda_param_read(codec, codec->afg, AC_PAR_AMP_OUT_CAP);
spec->def_amp_in_caps = snd_hda_param_read(codec, codec->afg, AC_PAR_AMP_IN_CAP);
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 1c53e337ecb..b2bcd94cf7a 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1646,7 +1646,8 @@ static int __devinit create_codec_pcm(struct azx *chip, struct hda_codec *codec,
if (!cpcm->stream[0].substreams && !cpcm->stream[1].substreams)
return 0;
- snd_assert(cpcm->name, return -EINVAL);
+ if (snd_BUG_ON(!cpcm->name))
+ return -EINVAL;
err = snd_pcm_new(chip->card, cpcm->name, cpcm->device,
cpcm->stream[0].substreams,
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 4bd26725355..7e5422f64ca 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2633,12 +2633,14 @@ static int alc_build_pcms(struct hda_codec *codec)
info->name = spec->stream_name_analog;
if (spec->stream_analog_playback) {
- snd_assert(spec->multiout.dac_nids, return -EINVAL);
+ if (snd_BUG_ON(!spec->multiout.dac_nids))
+ return -EINVAL;
info->stream[SNDRV_PCM_STREAM_PLAYBACK] = *(spec->stream_analog_playback);
info->stream[SNDRV_PCM_STREAM_PLAYBACK].nid = spec->multiout.dac_nids[0];
}
if (spec->stream_analog_capture) {
- snd_assert(spec->adc_nids, return -EINVAL);
+ if (snd_BUG_ON(!spec->adc_nids))
+ return -EINVAL;
info->stream[SNDRV_PCM_STREAM_CAPTURE] = *(spec->stream_analog_capture);
info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adc_nids[0];
}