From: Atsushi Nemoto Date: Wed, 16 Dec 2009 00:46:04 +0000 (-0800) Subject: rtc-stk17ta8: fix races around device registration X-Git-Tag: v2.6.33-rc1~71^2~150 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3151520d88b27b9dd4fb1c1f89a94807f0ad7ef1;p=pandora-kernel.git rtc-stk17ta8: 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_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 Cc: Alessandro Zummo Cc: Thomas Hommel Cc: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed