Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965695AbdCXOPw (ORCPT ); Fri, 24 Mar 2017 10:15:52 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:35619 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965313AbdCXOPa (ORCPT ); Fri, 24 Mar 2017 10:15:30 -0400 From: Geliang Tang To: Jiri Kosina , Jens Axboe , Mike Christie , Hannes Reinecke , Dan Williams Cc: Geliang Tang , linux-kernel@vger.kernel.org Subject: [PATCH] block: floppy: use setup_timer Date: Fri, 24 Mar 2017 22:15:10 +0800 Message-Id: <458035c91812e9de996605012e897ff85b9fffb8.1490341514.git.geliangtang@gmail.com> 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: 771 Lines: 24 Use setup_timer() instead of init_timer() to simplify the code. Signed-off-by: Geliang Tang --- drivers/block/floppy.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 45b4384..ce102ec 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -4207,9 +4207,7 @@ static int __init do_floppy_init(void) disks[drive]->fops = &floppy_fops; sprintf(disks[drive]->disk_name, "fd%d", drive); - init_timer(&motor_off_timer[drive]); - motor_off_timer[drive].data = drive; - motor_off_timer[drive].function = motor_off_callback; + setup_timer(&motor_off_timer[drive], motor_off_callback, drive); } err = register_blkdev(FLOPPY_MAJOR, "fd"); -- 2.9.3