Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: m41t80: use rtc_lock/rtc_unlock

Avoid accessing directly rtc->ops_lock and use the RTC core helpers.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20210119220653.677750-8-alexandre.belloni@bootlin.com

+4 -5
+4 -5
drivers/rtc/rtc-m41t80.c
··· 158 158 { 159 159 struct i2c_client *client = dev_id; 160 160 struct m41t80_data *m41t80 = i2c_get_clientdata(client); 161 - struct mutex *lock = &m41t80->rtc->ops_lock; 162 161 unsigned long events = 0; 163 162 int flags, flags_afe; 164 163 165 - mutex_lock(lock); 164 + rtc_lock(m41t80->rtc); 166 165 167 166 flags_afe = i2c_smbus_read_byte_data(client, M41T80_REG_ALARM_MON); 168 167 if (flags_afe < 0) { 169 - mutex_unlock(lock); 168 + rtc_unlock(m41t80->rtc); 170 169 return IRQ_NONE; 171 170 } 172 171 173 172 flags = i2c_smbus_read_byte_data(client, M41T80_REG_FLAGS); 174 173 if (flags <= 0) { 175 - mutex_unlock(lock); 174 + rtc_unlock(m41t80->rtc); 176 175 return IRQ_NONE; 177 176 } 178 177 ··· 188 189 flags_afe); 189 190 } 190 191 191 - mutex_unlock(lock); 192 + rtc_unlock(m41t80->rtc); 192 193 193 194 return IRQ_HANDLED; 194 195 }