On 02/08/2017 at 07:27:27 +0200, Sean Nyekjaer wrote: > +static int ds1308_write_control(struct ds1307 *ds1307, u8 mask, u8 value) > +{ > + struct mutex *lock = &ds1307->rtc->ops_lock; > + int ret; > + > + mutex_lock(lock); > + ret = regmap_update_bits(ds1307->regmap, DS1307_REG_CONTROL, > + mask, value); This access is already properly locked, you don't need ds1308_write_control. (I know, the function below is not necessary either but it is there for historical reasons). > + mutex_unlock(lock); > + > + return ret; > +} > + > static int ds1337_write_control(struct ds1307 *ds1307, u8 mask, u8 value) > { > struct mutex *lock = &ds1307->rtc->ops_lock; -- Alexandre Belloni, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com