Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964933AbdCXOQ7 (ORCPT ); Fri, 24 Mar 2017 10:16:59 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:36392 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965748AbdCXOQ0 (ORCPT ); Fri, 24 Mar 2017 10:16:26 -0400 From: Geliang Tang To: Jens Axboe , Bartlomiej Zolnierkiewicz , Mike Christie Cc: Geliang Tang , linux-kernel@vger.kernel.org Subject: [PATCH] mg_disk: use setup_timer Date: Fri, 24 Mar 2017 22:15:13 +0800 Message-Id: X-Mailer: git-send-email 2.9.3 In-Reply-To: <4841d2c2936addc27a2e774041d04ec16885ba03.1490341208.git.geliangtang@gmail.com> References: <4841d2c2936addc27a2e774041d04ec16885ba03.1490341208.git.geliangtang@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 794 Lines: 24 Use setup_timer() instead of init_timer() to simplify the code. Signed-off-by: Geliang Tang --- 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