diff --git a/drivers/watchdog/ar7_wdt.c b/drivers/watchdog/ar7_wdt.c index b29221783598f7ab2cfc2030d702b6263089a719..b9564c5ddab98c2acf466b326b2b57e154e2fa0e 100644 --- a/drivers/watchdog/ar7_wdt.c +++ b/drivers/watchdog/ar7_wdt.c @@ -70,8 +70,8 @@ struct ar7_wdt { }; static unsigned long wdt_is_open; -static spinlock_t wdt_lock; static unsigned expect_close; +static DEFINE_SPINLOCK(wdt_lock); /* XXX currently fixed, allows max margin ~68.72 secs */ #define prescale_value 0xffff @@ -280,8 +280,6 @@ static int __devinit ar7_wdt_probe(struct platform_device *pdev) { int rc; - spin_lock_init(&wdt_lock); - ar7_regs_wdt = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); if (!ar7_regs_wdt) { diff --git a/drivers/watchdog/cpu5wdt.c b/drivers/watchdog/cpu5wdt.c index edd3475f41db7ef2494a9befb7256b0e88262c72..251c863d71ddc123481a1bb4743973c8ebde02b6 100644 --- a/drivers/watchdog/cpu5wdt.c +++ b/drivers/watchdog/cpu5wdt.c @@ -39,7 +39,7 @@ static int verbose; static int port = 0x91; static int ticks = 10000; -static spinlock_t cpu5wdt_lock; +static DEFINE_SPINLOCK(cpu5wdt_lock); #define PFX "cpu5wdt: " @@ -223,7 +223,6 @@ static int __devinit cpu5wdt_init(void) "port=0x%x, verbose=%i\n", port, verbose); init_completion(&cpu5wdt_device.stop); - spin_lock_init(&cpu5wdt_lock); cpu5wdt_device.queue = 0; setup_timer(&cpu5wdt_device.timer, cpu5wdt_trigger, 0); cpu5wdt_device.default_ticks = ticks; diff --git a/drivers/watchdog/eurotechwdt.c b/drivers/watchdog/eurotechwdt.c index 41018d429abb14ff80b0309d2b85bd6f53b745af..3946c51099c07c6fc211658fd0df5aa51a8970bb 100644 --- a/drivers/watchdog/eurotechwdt.c +++ b/drivers/watchdog/eurotechwdt.c @@ -64,7 +64,7 @@ static unsigned long eurwdt_is_open; static int eurwdt_timeout; static char eur_expect_close; -static spinlock_t eurwdt_lock; +static DEFINE_SPINLOCK(eurwdt_lock); /* * You must set these - there is no sane way to probe for this board. @@ -446,8 +446,6 @@ static int __init eurwdt_init(void) goto outreg; } - spin_lock_init(&eurwdt_lock); - ret = misc_register(&eurwdt_miscdev); if (ret) { printk(KERN_ERR "eurwdt: can't misc_register on minor=%d\n", diff --git a/drivers/watchdog/ibmasr.c b/drivers/watchdog/ibmasr.c index 195e0f798e769d4fda32ea7e164b3fd818c41d69..c7481ad51629d5b3a47088e0b37466673c2c0afc 100644 --- a/drivers/watchdog/ibmasr.c +++ b/drivers/watchdog/ibmasr.c @@ -68,7 +68,7 @@ static char asr_expect_close; static unsigned int asr_type, asr_base, asr_length; static unsigned int asr_read_addr, asr_write_addr; static unsigned char asr_toggle_mask, asr_disable_mask; -static spinlock_t asr_lock; +static DEFINE_SPINLOCK(asr_lock); static void __asr_toggle(void) { @@ -386,8 +386,6 @@ static int __init ibmasr_init(void) if (!asr_type) return -ENODEV; - spin_lock_init(&asr_lock); - rc = asr_get_base_address(); if (rc) return rc; diff --git a/drivers/watchdog/indydog.c b/drivers/watchdog/indydog.c index 1cc5609666d10fe45f513c24393232f8180a3ec9..1475e09f9af214f5656e6d4ff9b1067555f5554f 100644 --- a/drivers/watchdog/indydog.c +++ b/drivers/watchdog/indydog.c @@ -28,7 +28,7 @@ #define PFX "indydog: " static unsigned long indydog_alive; -static spinlock_t indydog_lock; +static DEFINE_SPINLOCK(indydog_lock); #define WATCHDOG_TIMEOUT 30 /* 30 sec default timeout */ @@ -185,8 +185,6 @@ static int __init watchdog_init(void) { int ret; - spin_lock_init(&indydog_lock); - ret = register_reboot_notifier(&indydog_notifier); if (ret) { printk(KERN_ERR PFX diff --git a/drivers/watchdog/iop_wdt.c b/drivers/watchdog/iop_wdt.c index aef94789019f3ffb886fb5aadd9f15e8575c982c..82fa7a92a8d280b7f439489dd43ac70e97e5b86d 100644 --- a/drivers/watchdog/iop_wdt.c +++ b/drivers/watchdog/iop_wdt.c @@ -37,7 +37,7 @@ static int nowayout = WATCHDOG_NOWAYOUT; static unsigned long wdt_status; static unsigned long boot_status; -static spinlock_t wdt_lock; +static DEFINE_SPINLOCK(wdt_lock); #define WDT_IN_USE 0 #define WDT_OK_TO_CLOSE 1 @@ -226,9 +226,6 @@ static int __init iop_wdt_init(void) { int ret; - spin_lock_init(&wdt_lock); - - /* check if the reset was caused by the watchdog timer */ boot_status = (read_rcsr() & IOP_RCSR_WDT) ? WDIOF_CARDRESET : 0; diff --git a/drivers/watchdog/ixp2000_wdt.c b/drivers/watchdog/ixp2000_wdt.c index e86952a7168c8b247ea5e9252c1977ba38bde94f..084f71aa855a7a7599359d081ca30478386998ef 100644 --- a/drivers/watchdog/ixp2000_wdt.c +++ b/drivers/watchdog/ixp2000_wdt.c @@ -32,7 +32,7 @@ static int nowayout = WATCHDOG_NOWAYOUT; static unsigned int heartbeat = 60; /* (secs) Default is 1 minute */ static unsigned long wdt_status; -static spinlock_t wdt_lock; +static DEFINE_SPINLOCK(wdt_lock); #define WDT_IN_USE 0 #define WDT_OK_TO_CLOSE 1 @@ -189,7 +189,6 @@ static int __init ixp2000_wdt_init(void) return -EIO; } wdt_tick_rate = (*IXP2000_T1_CLD * HZ) / 256; - spin_lock_init(&wdt_lock); return misc_register(&ixp2000_wdt_miscdev); } diff --git a/drivers/watchdog/ixp4xx_wdt.c b/drivers/watchdog/ixp4xx_wdt.c index e02c0ecda26b73a7688ddc3352e99016350b67ab..4fc2e9ac26f7c818768c0e6f1a05a78b789cd7e7 100644 --- a/drivers/watchdog/ixp4xx_wdt.c +++ b/drivers/watchdog/ixp4xx_wdt.c @@ -181,7 +181,6 @@ static int __init ixp4xx_wdt_init(void) return -ENODEV; } - spin_lock_init(&wdt_lock); boot_status = (*IXP4XX_OSST & IXP4XX_OSST_TIMER_WARM_RESET) ? WDIOF_CARDRESET : 0; ret = misc_register(&ixp4xx_wdt_miscdev); diff --git a/drivers/watchdog/ks8695_wdt.c b/drivers/watchdog/ks8695_wdt.c index 811471903e8a7390f68d46b60998307be76b2be1..51757a520e8f07d96f8e247b960eda886fda8528 100644 --- a/drivers/watchdog/ks8695_wdt.c +++ b/drivers/watchdog/ks8695_wdt.c @@ -42,7 +42,7 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" static unsigned long ks8695wdt_busy; -static spinlock_t ks8695_lock; +static DEFINE_SPINLOCK(ks8695_lock); /* ......................................................................... */ @@ -288,7 +288,6 @@ static struct platform_driver ks8695wdt_driver = { static int __init ks8695_wdt_init(void) { - spin_lock_init(&ks8695_lock); /* Check that the heartbeat value is within range; if not reset to the default */ if (ks8695_wdt_settimeout(wdt_time)) { diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c index 2b4acb86c191eec0c4a23f0541eb0c8d33079445..cd269b4574d183b9408105beeea3c9fdb1eb76a6 100644 --- a/drivers/watchdog/omap_wdt.c +++ b/drivers/watchdog/omap_wdt.c @@ -55,7 +55,7 @@ module_param(timer_margin, uint, 0); MODULE_PARM_DESC(timer_margin, "initial watchdog timeout (in seconds)"); static unsigned int wdt_trgr_pattern = 0x1234; -static spinlock_t wdt_lock; +static DEFINE_SPINLOCK(wdt_lock); struct omap_wdt_dev { void __iomem *base; /* physical */ @@ -439,7 +439,6 @@ static struct platform_driver omap_wdt_driver = { static int __init omap_wdt_init(void) { - spin_lock_init(&wdt_lock); return platform_driver_register(&omap_wdt_driver); } diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c index 2d9fb96a9ee9c42020f71903a403da9b769041a6..66bd97f7969a8cb1fc7cddaa73bd9d17809d3f52 100644 --- a/drivers/watchdog/orion_wdt.c +++ b/drivers/watchdog/orion_wdt.c @@ -41,7 +41,7 @@ static int heartbeat = -1; /* module parameter (seconds) */ static unsigned int wdt_max_duration; /* (seconds) */ static unsigned int wdt_tclk; static unsigned long wdt_status; -static spinlock_t wdt_lock; +static DEFINE_SPINLOCK(wdt_lock); static void orion_wdt_ping(void) { @@ -296,7 +296,6 @@ static struct platform_driver orion_wdt_driver = { static int __init orion_wdt_init(void) { - spin_lock_init(&wdt_lock); return platform_driver_register(&orion_wdt_driver); }