4 Apr
2011
4 Apr
'11
7:55 a.m.
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.