diff options
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index d2e1093f8e97..77fbcd4a69b7 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, | |||
211 | unsigned int shift, num_elems, mask; | 211 | unsigned int shift, num_elems, mask; |
212 | hda_nid_t prev_nid; | 212 | hda_nid_t prev_nid; |
213 | 213 | ||
214 | snd_assert(conn_list && max_conns > 0, return -EINVAL); | 214 | if (snd_BUG_ON(!conn_list || max_conns <= 0)) |
215 | return -EINVAL; | ||
215 | 216 | ||
216 | parm = snd_hda_param_read(codec, nid, AC_PAR_CONNLIST_LEN); | 217 | parm = snd_hda_param_read(codec, nid, AC_PAR_CONNLIST_LEN); |
217 | if (parm & AC_CLIST_LONG) { | 218 | if (parm & AC_CLIST_LONG) { |
@@ -407,8 +408,10 @@ int __devinit snd_hda_bus_new(struct snd_card *card, | |||
407 | .dev_free = snd_hda_bus_dev_free, | 408 | .dev_free = snd_hda_bus_dev_free, |
408 | }; | 409 | }; |
409 | 410 | ||
410 | snd_assert(temp, return -EINVAL); | 411 | if (snd_BUG_ON(!temp)) |
411 | snd_assert(temp->ops.command && temp->ops.get_response, return -EINVAL); | 412 | return -EINVAL; |
413 | if (snd_BUG_ON(!temp->ops.command || !temp->ops.get_response)) | ||
414 | return -EINVAL; | ||
412 | 415 | ||
413 | if (busp) | 416 | if (busp) |
414 | *busp = NULL; | 417 | *busp = NULL; |
@@ -588,8 +591,10 @@ int __devinit snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr, | |||
588 | char component[13]; | 591 | char component[13]; |
589 | int err; | 592 | int err; |
590 | 593 | ||
591 | snd_assert(bus, return -EINVAL); | 594 | if (snd_BUG_ON(!bus)) |
592 | snd_assert(codec_addr <= HDA_MAX_CODEC_ADDRESS, return -EINVAL); | 595 | return -EINVAL; |
596 | if (snd_BUG_ON(codec_addr > HDA_MAX_CODEC_ADDRESS)) | ||
597 | return -EINVAL; | ||
593 | 598 | ||
594 | if (bus->caddr_tbl[codec_addr]) { | 599 | if (bus->caddr_tbl[codec_addr]) { |
595 | snd_printk(KERN_ERR "hda_codec: " | 600 | snd_printk(KERN_ERR "hda_codec: " |
@@ -2236,11 +2241,13 @@ static int __devinit set_pcm_default_values(struct hda_codec *codec, | |||
2236 | if (info->ops.close == NULL) | 2241 | if (info->ops.close == NULL) |
2237 | info->ops.close = hda_pcm_default_open_close; | 2242 | info->ops.close = hda_pcm_default_open_close; |
2238 | if (info->ops.prepare == NULL) { | 2243 | if (info->ops.prepare == NULL) { |
2239 | snd_assert(info->nid, return -EINVAL); | 2244 | if (snd_BUG_ON(!info->nid)) |
2245 | return -EINVAL; | ||
2240 | info->ops.prepare = hda_pcm_default_prepare; | 2246 | info->ops.prepare = hda_pcm_default_prepare; |
2241 | } | 2247 | } |
2242 | if (info->ops.cleanup == NULL) { | 2248 | if (info->ops.cleanup == NULL) { |
2243 | snd_assert(info->nid, return -EINVAL); | 2249 | if (snd_BUG_ON(!info->nid)) |
2250 | return -EINVAL; | ||
2244 | info->ops.cleanup = hda_pcm_default_cleanup; | 2251 | info->ops.cleanup = hda_pcm_default_cleanup; |
2245 | } | 2252 | } |
2246 | return 0; | 2253 | return 0; |