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

From: Guenter Roeck
Date: Tue May 10 2016 - 17:52:21 EST


On Fri, May 06, 2016 at 06:29:40PM +0530, Muhammad Falak R Wani wrote:
> 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.
>
> Signed-off-by: Muhammad Falak R Wani <falakreyaz@xxxxxxxxx>

Reviewed-by: Guenter Roeck <linux@xxxxxxxxxxxx>

> ---
> drivers/watchdog/cpwd.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/watchdog/cpwd.c b/drivers/watchdog/cpwd.c
> index 0200768..71ee079 100644
> --- a/drivers/watchdog/cpwd.c
> +++ b/drivers/watchdog/cpwd.c
> @@ -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",
> --
> 1.9.1
>