rtc: make rtc_update_irq callable with irqs enabled

The rtc_update_irq() might be called with irqs enabled, if a interrupt
handler was registered without IRQF_DISABLED.  Use
spin_lock_irqsave/spin_unlock_irqrestore instead of spin_lock/spin_unlock.

Also update kerneldoc and drivers which do extra work to follow the
current interface spec, as suggestted by David Brownell.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Atsushi Nemoto
2009-06-18 16:49:09 -07:00
committed by Linus Torvalds
parent 575c5807f6
commit e6229bec25
6 changed files with 10 additions and 25 deletions

View File

@@ -267,12 +267,7 @@ static void ds1307_work(struct work_struct *work)
control &= ~DS1337_BIT_A1IE;
i2c_smbus_write_byte_data(client, DS1337_REG_CONTROL, control);
/* rtc_update_irq() assumes that it is called
* from IRQ-disabled context.
*/
local_irq_disable();
rtc_update_irq(ds1307->rtc, 1, RTC_AF | RTC_IRQF);
local_irq_enable();
}
out: