libata: use setup_deferrable_timer
authorGeliang Tang <geliangtang@gmail.com>
Sat, 11 Mar 2017 00:47:01 +0000 (08:47 +0800)
committerTejun Heo <tj@kernel.org>
Mon, 13 Mar 2017 17:07:29 +0000 (13:07 -0400)
Use setup_deferrable_timer() instead of init_timer_deferrable() to
simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
drivers/ata/libata-core.c

index ca75823697dd1d7c359fcc396946c57070f6e41d..55d3c8b8b35b37037fa1567983d050295c9a8a21 100644 (file)
@@ -5902,9 +5902,9 @@ struct ata_port *ata_port_alloc(struct ata_host *host)
        INIT_LIST_HEAD(&ap->eh_done_q);
        init_waitqueue_head(&ap->eh_wait_q);
        init_completion(&ap->park_req_pending);
-       init_timer_deferrable(&ap->fastdrain_timer);
-       ap->fastdrain_timer.function = ata_eh_fastdrain_timerfn;
-       ap->fastdrain_timer.data = (unsigned long)ap;
+       setup_deferrable_timer(&ap->fastdrain_timer,
+                              ata_eh_fastdrain_timerfn,
+                              (unsigned long)ap);
 
        ap->cbl = ATA_CBL_NONE;