> + if (eeprom->read_only) > + return 0; What about: if (!eeprom->read_only) { spin_lock(&eeprom->buffer_lock); eeprom->buffer[eeprom->buffer_idx++ & eeprom->address_mask] = *val; spin_unlock(&eeprom->buffer_lock); } We can still keep only one exit point from the function this way. > { "slave-24c02", I2C_SLAVE_DEVICE_MAGIC(2048 / 8, 0) }, > + { "slave-24c02", I2C_SLAVE_DEVICE_MAGIC(2048 / 8, I2C_SLAVE_FLAG_RO) }, "ro" missing. You haven't tested this entry ;)
Attachment:
signature.asc
Description: PGP signature