Re: [PATCH 1/2] ALSA: sscape: Cache per-card resources for board reinitialization

Takashi Iwai
2026-04-11T08:08:00Z

On Sat, 11 Apr 2026 06:54:29 +0200,
Cássio Gabriel wrote:
> +/*
> + * Restore the SoundScape's MIDI control state after the firmware
> + * upload has made the host interface available again.
> + */
> +static int sscape_restore_midi_state(struct soundscape *sscape)
> +{
> + int err = 1;
> +
> + guard(spinlock_irqsave)(&sscape->lock);
> + set_host_mode_unsafe(sscape->io_base);
> + err &= host_write_ctrl_unsafe(sscape->io_base, CMD_SET_MIDI_VOL, 100);
> + err &= host_write_ctrl_unsafe(sscape->io_base, sscape->midi_vol, 100);
> + err &= host_write_ctrl_unsafe(sscape->io_base, CMD_XXX_MIDI_VOL, 100);
> + err &= host_write_ctrl_unsafe(sscape->io_base, sscape->midi_vol, 100);
> + err &= host_write_ctrl_unsafe(sscape->io_base, CMD_SET_EXTMIDI, 100);
> + err &= host_write_ctrl_unsafe(sscape->io_base, 0, 100);
> + err &= host_write_ctrl_unsafe(sscape->io_base, CMD_ACK, 100);
> + set_midi_mode_unsafe(sscape->io_base);
> +
> + return err ? 0 : -EIO;

The above means it checks only the error of the last write.
Is it intentional?

thanks,

Takashi