watchdog: Use DEFINE_SPINLOCK() for static spinlocks
PATCH 1/1 watchdog: Use DEFINE_SPINLOCK() for static spinlocks
Rather than just defining static spinlock_t variables and then initializing them later in init functions, simply define them with DEFINE_SPINLOCK() and remove the calls to spin_lock_init().
Cc Nicolas Thill <[email protected]>
Cc Heiko Ronsdorf <[email protected]>
Cc Rodolfo Giometti <[email protected]>
Cc Andrey Panin <[email protected]>
Cc Guido Guenther <[email protected]>
Cc Curt E Bruns <[email protected]>
Cc Deepak Saxena <[email protected]>
Cc Andrew Victor <[email protected]>
Cc George G. Davis <[email protected]>
Cc Sylver Bruneau <[email protected]>
Signed-off-by Axel Lin <[email protected]>
--- drivers/watchdog/ar7_wdt.c | 4 +--- drivers/watchdog/cpu5wdt.c | 3 +-- drivers/watchdog/eurotechwdt.c | 4 +--- drivers/watchdog/ibmasr.c | 4 +--- drivers/watchdog/indydog.c | 4 +--- drivers/watchdog/iop_wdt.c | 5 +---- drivers/watchdog/ixp2000_wdt.c | 3 +-- drivers/watchdog/ixp4xx_wdt.c | 1 - drivers/watchdog/ks8695_wdt.c | 3 +-- drivers/watchdog/omap_wdt.c | 3 +-- drivers/watchdog/orion_wdt.c | 3 +-- 11 files changed, 10 insertions(+), 27 deletions(-)
drivers/watchdog/ar7_wdt.c +1 -3
@@ -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) {
drivers/watchdog/cpu5wdt.c +1 -2
@@ -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;
drivers/watchdog/eurotechwdt.c +1 -3
@@ -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",
drivers/watchdog/ibmasr.c +1 -3
@@ -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;
drivers/watchdog/indydog.c +1 -3
@@ -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
drivers/watchdog/iop_wdt.c +1 -4
@@ -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 ;
drivers/watchdog/ixp2000_wdt.c +1 -2
@@ -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); }
drivers/watchdog/ixp4xx_wdt.c +0 -1
@@ -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);
drivers/watchdog/ks8695_wdt.c +1 -2
@@ -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)) {
drivers/watchdog/omap_wdt.c +1 -2
@@ -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); }
drivers/watchdog/orion_wdt.c +1 -2
@@ -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); }
Signature · 1 line
1.7.5.4