Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1608444 > unrolled thread

[PATCH] mg_disk: use setup_timer

Started byGeliang Tang <geliangtang@gmail.com>
First post2017-03-24 15:20 +0100
Last post2017-03-24 15:20 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH] mg_disk: use setup_timer Geliang Tang <geliangtang@gmail.com> - 2017-03-24 15:20 +0100

#1608444 — [PATCH] mg_disk: use setup_timer

FromGeliang Tang <geliangtang@gmail.com>
Date2017-03-24 15:20 +0100
Subject[PATCH] mg_disk: use setup_timer
Message-ID<toyem-2LK-31@gated-at.bofh.it>
Use setup_timer() instead of init_timer() to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 drivers/block/mg_disk.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c
index 286f276..e88e7b0 100644
--- a/drivers/block/mg_disk.c
+++ b/drivers/block/mg_disk.c
@@ -989,9 +989,7 @@ static int mg_probe(struct platform_device *plat_dev)
 	blk_queue_max_hw_sectors(host->breq, MG_MAX_SECTS);
 	blk_queue_logical_block_size(host->breq, MG_SECTOR_SIZE);
 
-	init_timer(&host->timer);
-	host->timer.function = mg_times_out;
-	host->timer.data = (unsigned long)host;
+	setup_timer(&host->timer, mg_times_out, (unsigned long)host);
 
 	host->gd = alloc_disk(MG_DISK_MAX_PART);
 	if (!host->gd) {
-- 
2.9.3

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web