ALSA: sparc: Fix assignment in if condition

SPARC drivers contain a few assignments in if condition, which is a
bad coding style that may confuse readers and occasionally lead to
bugs.

This patch is merely for coding-style fixes, no functional changes.

Link: https://lore.kernel.org/r/20210608140540.17885-59-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2021-06-08 16:05:32 +02:00
parent 2073fa449d
commit bdab9e5c3e
3 changed files with 21 additions and 14 deletions

View File

@ -975,8 +975,9 @@ static int snd_amd7930_create(struct snd_card *card,
spin_unlock_irqrestore(&amd->lock, flags);
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL,
amd, &snd_amd7930_dev_ops)) < 0) {
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL,
amd, &snd_amd7930_dev_ops);
if (err < 0) {
snd_amd7930_free(amd);
return err;
}
@ -1019,13 +1020,16 @@ static int amd7930_sbus_probe(struct platform_device *op)
irq, dev_num, &amd)) < 0)
goto out_err;
if ((err = snd_amd7930_pcm(amd)) < 0)
err = snd_amd7930_pcm(amd);
if (err < 0)
goto out_err;
if ((err = snd_amd7930_mixer(amd)) < 0)
err = snd_amd7930_mixer(amd);
if (err < 0)
goto out_err;
if ((err = snd_card_register(card)) < 0)
err = snd_card_register(card);
if (err < 0)
goto out_err;
amd->next = amd7930_list;

View File

@ -1828,8 +1828,9 @@ static int snd_cs4231_sbus_create(struct snd_card *card,
}
snd_cs4231_init(chip);
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL,
chip, &snd_cs4231_sbus_dev_ops)) < 0) {
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL,
chip, &snd_cs4231_sbus_dev_ops);
if (err < 0) {
snd_cs4231_sbus_free(chip);
return err;
}
@ -2020,8 +2021,9 @@ static int snd_cs4231_ebus_create(struct snd_card *card,
}
snd_cs4231_init(chip);
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL,
chip, &snd_cs4231_ebus_dev_ops)) < 0) {
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL,
chip, &snd_cs4231_ebus_dev_ops);
if (err < 0) {
snd_cs4231_ebus_free(chip);
return err;
}

View File

@ -2226,11 +2226,12 @@ static int snd_dbri_pcm(struct snd_card *card)
struct snd_pcm *pcm;
int err;
if ((err = snd_pcm_new(card,
/* ID */ "sun_dbri",
/* device */ 0,
/* playback count */ 1,
/* capture count */ 1, &pcm)) < 0)
err = snd_pcm_new(card,
/* ID */ "sun_dbri",
/* device */ 0,
/* playback count */ 1,
/* capture count */ 1, &pcm);
if (err < 0)
return err;
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_dbri_ops);