staging: greybus: Use setup_timer function
authorsayli karnik <karniksayli1995@gmail.com>
Thu, 22 Sep 2016 16:39:06 +0000 (22:09 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Sep 2016 17:00:43 +0000 (19:00 +0200)
This patch uses setup_timer function instead of initializing timer with the
function and data fields.

Signed-off-by: sayli karnik <karniksayli1995@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/greybus/loopback.c

index 8b0d0dc2ed8bc2c7a6fa8ade74a56d15f9d575bd..7882306adeca9e3737a90003a806c06185cdc0ea 100644 (file)
@@ -603,7 +603,6 @@ static int gb_loopback_async_operation(struct gb_loopback *gb, int type,
                return -ENOMEM;
 
        INIT_WORK(&op_async->work, gb_loopback_async_operation_work);
-       init_timer(&op_async->timer);
        kref_init(&op_async->kref);
 
        operation = gb_operation_create(gb->connection, type, request_size,
@@ -634,9 +633,9 @@ static int gb_loopback_async_operation(struct gb_loopback *gb, int type,
        if (ret)
                goto error;
 
-       op_async->timer.function = gb_loopback_async_operation_timeout;
+       setup_timer(&op_async->timer, gb_loopback_async_operation_timeout,
+                       (unsigned long)operation->id);
        op_async->timer.expires = jiffies + gb->jiffy_timeout;
-       op_async->timer.data = (unsigned long)operation->id;
        add_timer(&op_async->timer);
 
        goto done;