Hello Mark, On 16/04/2014 19:06, Mark Brown wrote: > On Wed, Apr 16, 2014 at 10:16:10AM +0200, Boris BREZILLON wrote: > >> + if (i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C)) { >> + return ®map_i2c; >> + } else if (config->val_bits == 16 && >> + i2c_check_functionality(i2c->adapter, >> + I2C_FUNC_SMBUS_WORD_DATA)) { >> + config->reg_read = regmap_smbus_word_reg_read; >> + config->reg_write = regmap_smbus_word_reg_write; >> + return NULL; > This all looks good to me except we shouldn't be modifying the config > struct (it's supposed to be const). We should instead add the ability > for the bus to set these ops - that'll also be useful for things like > AC'97.
Actually I do not modify the passed config struct, I copy the config values into a local instance and then modify this local instance appropriately. But I agree that having a proper way to overload config parameters would be better. Any suggestion on how this should be done ? Best Regards, Boris -- Boris Brezillon, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/