[WATCHDOG] spin_lock_init() fixes
Some watchdog drivers initialize global spinlocks in module's init function which is tolerable, but some do it in PCI probe function. So, switch to static initialization to fix theoretical bugs and, more importantly, stop giving people bad examples. Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru> Signed-off-by: Wim Van Sebroeck <wim@iguana.be> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
committed by
Wim Van Sebroeck
parent
2ba7d7b39f
commit
c7dfd0cca3
@ -77,7 +77,7 @@
|
||||
|
||||
/* internal variables */
|
||||
static void __iomem *BASEADDR;
|
||||
static spinlock_t esb_lock; /* Guards the hardware */
|
||||
static DEFINE_SPINLOCK(esb_lock); /* Guards the hardware */
|
||||
static unsigned long timer_alive;
|
||||
static struct pci_dev *esb_pci;
|
||||
static unsigned short triggered; /* The status of the watchdog upon boot */
|
||||
@ -456,8 +456,6 @@ static int __init watchdog_init (void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
spin_lock_init(&esb_lock);
|
||||
|
||||
/* Check whether or not the hardware watchdog is there */
|
||||
if (!esb_getdevice () || esb_pci == NULL)
|
||||
return -ENODEV;
|
||||
|
Reference in New Issue
Block a user