[alsa-devel] [ALSA] ca0106: power down SPI DAC channels when not in use

Dan Carpenter dan.carpenter at oracle.com
Thu Feb 26 12:06:56 CET 2015


Hello Trent Piepho,

The patch 485100706b4b: "[ALSA] ca0106: power down SPI DAC channels
when not in use" from Jul 25, 2007, leads to the following static
checker warning:

	sound/pci/ca0106/ca0106_main.c:601 snd_ca0106_pcm_open_playback_channel()
	warn: bool is not less than zero.

sound/pci/ca0106/ca0106_main.c
   597  
   598          /* Front channel dac should already be on */
   599          if (channel_id != PCM_FRONT_CHANNEL) {
   600                  err = snd_ca0106_pcm_power_dac(chip, channel_id, 1);

Because of snd_ca0106_spi_write() then this function appears to return
zero on success and 1 on failure.  That's very strange.  None of the
callers expect a 1 return.  If they care about the return code then they
expect negative error codes.

   601                  if (err < 0)
   602                          return err;
   603          }
   604  

regards,
dan carpenter


More information about the Alsa-devel mailing list