On Fri, Jan 24, 2014 at 05:22:35PM +0530, Sachin Kamat wrote:
On 24 January 2014 16:40, Mark Brown broonie@kernel.org wrote:
On Fri, Jan 24, 2014 at 02:09:24PM +0530, Sachin Kamat wrote:
+#if IS_ENABLED(CONFIG_I2C) +static const char *wm8580_supply_names[WM8580_NUM_SUPPLIES] = {
"AVDD",
"DVDD",
"PVDD",
+};
This is obviously not sensible - the device doesn't suddenly stop needing power if it is using SPI.
This structure is being used only in wm8580_i2c_probe which is guarded by IS_ENABLED(CONFIG_I2C). Do you mean the existing implementation is wrong or we just need to move it out of the #if?
Think about what the code is doing - obviously there is a problem with the existing code here but this is not a good fix for it. Like I say it's not very likely that the device only requires power when used with I2C, it would be better to fix the fact that the driver is only using regulators for I2C.