[alsa-devel] [PATCH] ASoC: Fix to avoid compile error

Seungwhan Youn claude.youn at gmail.com
Mon Apr 4 07:05:41 CEST 2011

On Mon, Apr 4, 2011 at 1:55 PM, Mark Brown
<broonie at opensource.wolfsonmicro.com> wrote:
> On Mon, Apr 04, 2011 at 01:15:04PM +0900, Seungwhan Youn wrote:
>>       case SND_SOC_I2C:
>> +#if defined(CONFIG_I2C) || (defined(CONFIG_I2C_MODULE) && defined(MODULE))
>>               ret = i2c_master_send(codec->control_data, data, len);
>> +#endif
>>               break;
>>       case SND_SOC_SPI:
>> +#if defined(CONFIG_SPI_MASTER)
>>               ret = do_spi_write(codec->control_data, data, len);
>> +#endif
>>               break;
> If we're going to ifdef these out we should be ifdefing out the entire
> case, not just the operations.  Otherwise if we do manage to end up with
> a broken configuration then the code will silently report success which
> is broken - the fact that you have to initialise ret is a bad sign.

Indeed. I'll re-submit this right away.
Thank you for your comment.

More information about the Alsa-devel mailing list