summaryrefslogtreecommitdiff
path: root/sound/pci/nm256/nm256.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/nm256/nm256.c')
-rw-r--r--sound/pci/nm256/nm256.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index 06d13e71711..50c9f8a0508 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -562,7 +562,8 @@ snd_nm256_playback_trigger(struct snd_pcm_substream *substream, int cmd)
struct nm256_stream *s = substream->runtime->private_data;
int err = 0;
- snd_assert(s != NULL, return -ENXIO);
+ if (snd_BUG_ON(!s))
+ return -ENXIO;
spin_lock(&chip->reg_lock);
switch (cmd) {
@@ -599,7 +600,8 @@ snd_nm256_capture_trigger(struct snd_pcm_substream *substream, int cmd)
struct nm256_stream *s = substream->runtime->private_data;
int err = 0;
- snd_assert(s != NULL, return -ENXIO);
+ if (snd_BUG_ON(!s))
+ return -ENXIO;
spin_lock(&chip->reg_lock);
switch (cmd) {
@@ -635,7 +637,8 @@ static int snd_nm256_pcm_prepare(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime = substream->runtime;
struct nm256_stream *s = runtime->private_data;
- snd_assert(s, return -ENXIO);
+ if (snd_BUG_ON(!s))
+ return -ENXIO;
s->dma_size = frames_to_bytes(runtime, substream->runtime->buffer_size);
s->period_size = frames_to_bytes(runtime, substream->runtime->period_size);
s->periods = substream->runtime->periods;
@@ -660,7 +663,8 @@ snd_nm256_playback_pointer(struct snd_pcm_substream *substream)
struct nm256_stream *s = substream->runtime->private_data;
unsigned long curp;
- snd_assert(s, return 0);
+ if (snd_BUG_ON(!s))
+ return 0;
curp = snd_nm256_readl(chip, NM_PBUFFER_CURRP) - (unsigned long)s->buf;
curp %= s->dma_size;
return bytes_to_frames(substream->runtime, curp);
@@ -673,7 +677,8 @@ snd_nm256_capture_pointer(struct snd_pcm_substream *substream)
struct nm256_stream *s = substream->runtime->private_data;
unsigned long curp;
- snd_assert(s != NULL, return 0);
+ if (snd_BUG_ON(!s))
+ return 0;
curp = snd_nm256_readl(chip, NM_RBUFFER_CURRP) - (unsigned long)s->buf;
curp %= s->dma_size;
return bytes_to_frames(substream->runtime, curp);