Skip to contentSkip to conversation

watchdog: cpwd: Use setup_timer()

PATCH In review Muhammad Falak R Wani 3 participants 6 messages May 6, 2016 – May 14, 2016 Watchdog device drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 watchdog: cpwd: Use setup_timer()

The function setup_timer combines the initialization of a timer with the initialization of the timer's function and data fields. The multiline code for timer initialization is now replaced with function setup_timer.

---
 drivers/watchdog/cpwd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/watchdog/cpwd.c +1 -3
index 0200768..71ee079 100644
@@ -611,9 +611,7 @@ static int cpwd_probe(struct platform_device *op)
 	}
 
 	if (p->broken) {
-		init_timer(&cpwd_timer);
-		cpwd_timer.function	= cpwd_brokentimer;
-		cpwd_timer.data		= (unsigned long) p;
+		setup_timer(&cpwd_timer, cpwd_brokentimer, (unsigned long)p);
 		cpwd_timer.expires	= WD_BTIMEOUT;
 
 		pr_info("PLD defect workaround enabled for model %s\n",
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/2 watchdog: shwdt: Use setup_timer()

The function setup_timer combines the initialization of a timer with the initialization of the timer's function and data fields. The multiline code for timer initialization is now replaced with function setup_timer.

---
 drivers/watchdog/shwdt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/watchdog/shwdt.c +1 -3
index f908121..517a733 100644
@@ -275,9 +275,7 @@ static int sh_wdt_probe(struct platform_device *pdev)
 		return rc;
 	}
 
-	init_timer(&wdt->timer);
-	wdt->timer.function	= sh_wdt_ping;
-	wdt->timer.data		= (unsigned long)wdt;
+	setup_timer(&wdt->timer, sh_wdt_ping, (unsigned long)wdt);
 	wdt->timer.expires	= next_ping_period(clock_division_ratio);
 
 	dev_info(&pdev->dev, "initialized.\n");
Signature · 1 line
1.9.1
maintainer Reviewed-by on v1 1/2
#4 lore raw
In reply to Muhammad Falak R Wani
Quoted 6 lines · Muhammad Falak R Wani

The function setup_timer combines the initialization of a timer with the initialization of the timer's function and data fields. The multiline code for timer initialization is now replaced with function setup_timer.

Quoted 22 lines
---
 drivers/watchdog/cpwd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/watchdog/cpwd.c +1 -3
index 0200768..71ee079 100644
@@ -611,9 +611,7 @@ static int cpwd_probe(struct platform_device *op)
 	}
 
 	if (p->broken) {
-		init_timer(&cpwd_timer);
-		cpwd_timer.function	= cpwd_brokentimer;
-		cpwd_timer.data		= (unsigned long) p;
+		setup_timer(&cpwd_timer, cpwd_brokentimer, (unsigned long)p);
 		cpwd_timer.expires	= WD_BTIMEOUT;
 
 		pr_info("PLD defect workaround enabled for model %s\n",
Signature · 1 line
1.9.1
maintainer Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] watchdog: shwdt: Use setup_timer()

In reply to Muhammad Falak R Wani
Quoted 6 lines · Muhammad Falak R Wani

The function setup_timer combines the initialization of a timer with the initialization of the timer's function and data fields. The multiline code for timer initialization is now replaced with function setup_timer.

Quoted 26 lines
---
 drivers/watchdog/shwdt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/watchdog/shwdt.c +1 -3
index f908121..517a733 100644
@@ -275,9 +275,7 @@ static int sh_wdt_probe(struct platform_device *pdev)
 		return rc;
 	}
 
-	init_timer(&wdt->timer);
-	wdt->timer.function	= sh_wdt_ping;
-	wdt->timer.data		= (unsigned long)wdt;
+	setup_timer(&wdt->timer, sh_wdt_ping, (unsigned long)wdt);
 	wdt->timer.expires	= next_ping_period(clock_division_ratio);
 
 	dev_info(&pdev->dev, "initialized.\n");
Signature · 6 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#5 lore raw
In reply to Muhammad Falak R Wani

Hi Muhammed,

Quoted 28 lines

The function setup_timer combines the initialization of a timer with the initialization of the timer's function and data fields. The multiline code for timer initialization is now replaced with function setup_timer.

---
 drivers/watchdog/cpwd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/watchdog/cpwd.c +1 -3
index 0200768..71ee079 100644
@@ -611,9 +611,7 @@ static int cpwd_probe(struct platform_device *op)
 	}
 
 	if (p->broken) {
-		init_timer(&cpwd_timer);
-		cpwd_timer.function	= cpwd_brokentimer;
-		cpwd_timer.data		= (unsigned long) p;
+		setup_timer(&cpwd_timer, cpwd_brokentimer, (unsigned long)p);
 		cpwd_timer.expires	= WD_BTIMEOUT;
 
 		pr_info("PLD defect workaround enabled for model %s\n",
Signature · 1 line
1.9.1

This patch was added to linux-watchdog-next.

Kind Regards,
Wim.

#3 lore raw

Re: [PATCH 2/2] watchdog: shwdt: Use setup_timer()

In reply to Muhammad Falak R Wani

Hi Muhammed,

Quoted 28 lines

The function setup_timer combines the initialization of a timer with the initialization of the timer's function and data fields. The multiline code for timer initialization is now replaced with function setup_timer.

---
 drivers/watchdog/shwdt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/watchdog/shwdt.c +1 -3
index f908121..517a733 100644
@@ -275,9 +275,7 @@ static int sh_wdt_probe(struct platform_device *pdev)
 		return rc;
 	}
 
-	init_timer(&wdt->timer);
-	wdt->timer.function	= sh_wdt_ping;
-	wdt->timer.data		= (unsigned long)wdt;
+	setup_timer(&wdt->timer, sh_wdt_ping, (unsigned long)wdt);
 	wdt->timer.expires	= next_ping_period(clock_division_ratio);
 
 	dev_info(&pdev->dev, "initialized.\n");
Signature · 1 line
1.9.1

This patch was added to linux-watchdog-next.

Kind Regards,
Wim.