]> Git Repo - linux.git/commit
rtc-ds1511: fix races around device registration
authorAtsushi Nemoto <[email protected]>
Wed, 16 Dec 2009 00:45:58 +0000 (16:45 -0800)
committerLinus Torvalds <[email protected]>
Wed, 16 Dec 2009 15:19:59 +0000 (07:19 -0800)
commitba4f3e47cb9ef72f864f1b5548688e0a195011e9
tree1a115124e4923e85754c28c8773be67b586ec5b9
parenta8462ef63c961639a743f9fcddf408da46641281
rtc-ds1511: fix races around device registration

- Call dev_set_drvdata before rtc device creation.

- Use its own spinlock instead of rtc->irq_lock.  Because pdata->rtc
  must be initialized to use the irq_lock (pdata->rtc->irq_lock).  There
  is a small window which rtc methods can be called before pdata->rtc is
  initialized.

  And there is no need use the irq_lock to protect hardware registers.
  The driver's own spinlock shoule be enough.

- Check pdata->rtc before calling rtc_update_irq.

- Use {alarm,update}_irq_enable and remove ioctl routine.

- Use devres APIs and simplify error/remove path.

These fixes are ported from ds1553 driver and just compile-tested only.

Signed-off-by: Atsushi Nemoto <[email protected]>
Cc: Andrew Sharp <[email protected]>
Cc: Thomas Hommel <[email protected]>
Cc: David Brownell <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/rtc/rtc-ds1511.c
This page took 0.049247 seconds and 4 git commands to generate.