Commit 5cc16ba6 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: maestro3: Fix assignment in if condition

PCI maestro3 driver code contains 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-30-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 3a5f3dd3
...@@ -1765,7 +1765,8 @@ snd_m3_playback_open(struct snd_pcm_substream *subs) ...@@ -1765,7 +1765,8 @@ snd_m3_playback_open(struct snd_pcm_substream *subs)
struct snd_pcm_runtime *runtime = subs->runtime; struct snd_pcm_runtime *runtime = subs->runtime;
int err; int err;
if ((err = snd_m3_substream_open(chip, subs)) < 0) err = snd_m3_substream_open(chip, subs);
if (err < 0)
return err; return err;
runtime->hw = snd_m3_playback; runtime->hw = snd_m3_playback;
...@@ -1789,7 +1790,8 @@ snd_m3_capture_open(struct snd_pcm_substream *subs) ...@@ -1789,7 +1790,8 @@ snd_m3_capture_open(struct snd_pcm_substream *subs)
struct snd_pcm_runtime *runtime = subs->runtime; struct snd_pcm_runtime *runtime = subs->runtime;
int err; int err;
if ((err = snd_m3_substream_open(chip, subs)) < 0) err = snd_m3_substream_open(chip, subs);
if (err < 0)
return err; return err;
runtime->hw = snd_m3_capture; runtime->hw = snd_m3_capture;
...@@ -2036,12 +2038,14 @@ static int snd_m3_mixer(struct snd_m3 *chip) ...@@ -2036,12 +2038,14 @@ static int snd_m3_mixer(struct snd_m3 *chip)
.read = snd_m3_ac97_read, .read = snd_m3_ac97_read,
}; };
if ((err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus)) < 0) err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus);
if (err < 0)
return err; return err;
memset(&ac97, 0, sizeof(ac97)); memset(&ac97, 0, sizeof(ac97));
ac97.private_data = chip; ac97.private_data = chip;
if ((err = snd_ac97_mixer(pbus, &ac97, &chip->ac97)) < 0) err = snd_ac97_mixer(pbus, &ac97, &chip->ac97);
if (err < 0)
return err; return err;
/* seems ac97 PCM needs initialization.. hack hack.. */ /* seems ac97 PCM needs initialization.. hack hack.. */
...@@ -2642,16 +2646,19 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci, ...@@ -2642,16 +2646,19 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
if (err < 0) if (err < 0)
goto free_chip; goto free_chip;
if ((err = snd_m3_mixer(chip)) < 0) err = snd_m3_mixer(chip);
if (err < 0)
return err; return err;
for (i = 0; i < chip->num_substreams; i++) { for (i = 0; i < chip->num_substreams; i++) {
struct m3_dma *s = &chip->substreams[i]; struct m3_dma *s = &chip->substreams[i];
if ((err = snd_m3_assp_client_init(chip, s, i)) < 0) err = snd_m3_assp_client_init(chip, s, i);
if (err < 0)
return err; return err;
} }
if ((err = snd_m3_pcm(chip, 0)) < 0) err = snd_m3_pcm(chip, 0);
if (err < 0)
return err; return err;
#ifdef CONFIG_SND_MAESTRO3_INPUT #ifdef CONFIG_SND_MAESTRO3_INPUT
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment