On Thu, Mar 05, 2015 at 09:45:41AM +0000, Srinivas Kandagatla wrote:Thanks for spotting this, I will fix this in next version.
+
+ return eeprom;
+}
+EXPORT_SYMBOL(eeprom_register);
This framework uses regmap but regmap is EXPORT_SYMBOL_GPL() and this is
using EXPORT_SYMBOL().
Yes, you are right as long as we protect users variable with mutex, using atomic is really redundant, will fix it in next version.+int eeprom_unregister(struct eeprom_device *eeprom)
+{
+ mutex_lock(&eeprom_mutex);
+ if (atomic_read(&eeprom->users)) {
+ mutex_unlock(&eeprom_mutex);
Atomic reads and a mutex - isn't the mutex enough? Atomics are
generally a recipie for bugs due to the complexity in using them.