summaryrefslogtreecommitdiff
path: root/sound/pci/cs5535audio/cs5535audio_pcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/cs5535audio/cs5535audio_pcm.c')
-rw-r--r--sound/pci/cs5535audio/cs5535audio_pcm.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sound/pci/cs5535audio/cs5535audio_pcm.c b/sound/pci/cs5535audio/cs5535audio_pcm.c
index 9c88e99e3750..48b99a07e3bc 100644
--- a/sound/pci/cs5535audio/cs5535audio_pcm.c
+++ b/sound/pci/cs5535audio/cs5535audio_pcm.c
@@ -150,10 +150,9 @@ static int cs5535audio_build_dma_packets(struct cs5535audio *cs5535au,
dma->substream = substream;
dma->period_bytes = period_bytes;
dma->periods = periods;
- spin_lock_irq(&cs5535au->reg_lock);
+ guard(spinlock_irq)(&cs5535au->reg_lock);
dma->ops->disable_dma(cs5535au);
dma->ops->setup_prd(cs5535au, jmpprd_addr);
- spin_unlock_irq(&cs5535au->reg_lock);
return 0;
}
@@ -276,9 +275,8 @@ static int snd_cs5535audio_trigger(struct snd_pcm_substream *substream, int cmd)
{
struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream);
struct cs5535audio_dma *dma = substream->runtime->private_data;
- int err = 0;
- spin_lock(&cs5535au->reg_lock);
+ guard(spinlock)(&cs5535au->reg_lock);
switch (cmd) {
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
dma->ops->pause_dma(cs5535au);
@@ -300,11 +298,9 @@ static int snd_cs5535audio_trigger(struct snd_pcm_substream *substream, int cmd)
break;
default:
dev_err(cs5535au->card->dev, "unhandled trigger\n");
- err = -EINVAL;
- break;
+ return -EINVAL;
}
- spin_unlock(&cs5535au->reg_lock);
- return err;
+ return 0;
}
static snd_pcm_uframes_t snd_cs5535audio_pcm_pointer(struct snd_pcm_substream
@@ -423,7 +419,7 @@ int snd_cs5535audio_pcm(struct cs5535audio *cs5535au)
pcm->private_data = cs5535au;
pcm->info_flags = 0;
- strcpy(pcm->name, "CS5535 Audio");
+ strscpy(pcm->name, "CS5535 Audio");
snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
&cs5535au->pci->dev,