From patchwork Mon Jan 23 09:12:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 9531925 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B1FA860434 for ; Mon, 23 Jan 2017 09:13:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5B97205FB for ; Mon, 23 Jan 2017 09:13:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C92F2833C; Mon, 23 Jan 2017 09:13:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E443A205FB for ; Mon, 23 Jan 2017 09:13:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751056AbdAWJMg (ORCPT ); Mon, 23 Jan 2017 04:12:36 -0500 Received: from mx2.suse.de ([195.135.220.15]:48164 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750960AbdAWJMf (ORCPT ); Mon, 23 Jan 2017 04:12:35 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 96276ACA6; Mon, 23 Jan 2017 09:12:32 +0000 (UTC) From: Jiri Slaby To: hverkuil@xs4all.nl Cc: linux-kernel@vger.kernel.org, =?UTF-8?q?Matej=20Hul=C3=ADn?= , Jiri Slaby , Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: [PATCH] media: radio-cadet, initialize timer with setup_timer Date: Mon, 23 Jan 2017 10:12:30 +0100 Message-Id: <20170123091230.16248-1-jslaby@suse.cz> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Matej Hulín Stop accessing timer struct members directly and use the setup_timer helper intended for that use. It makes the code cleaner and will allow for easier change of the timer struct internals. Signed-off-by: Matej Hulín Signed-off-by: Jiri Slaby Cc: Hans Verkuil Cc: Mauro Carvalho Chehab Cc: --- drivers/media/radio/radio-cadet.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c index 82affaedf067..cbaf850f4791 100644 --- a/drivers/media/radio/radio-cadet.c +++ b/drivers/media/radio/radio-cadet.c @@ -309,9 +309,7 @@ static void cadet_handler(unsigned long data) /* * Clean up and exit */ - init_timer(&dev->readtimer); - dev->readtimer.function = cadet_handler; - dev->readtimer.data = data; + setup_timer(&dev->readtimer, cadet_handler, data); dev->readtimer.expires = jiffies + msecs_to_jiffies(50); add_timer(&dev->readtimer); } @@ -320,9 +318,7 @@ static void cadet_start_rds(struct cadet *dev) { dev->rdsstat = 1; outb(0x80, dev->io); /* Select RDS fifo */ - init_timer(&dev->readtimer); - dev->readtimer.function = cadet_handler; - dev->readtimer.data = (unsigned long)dev; + setup_timer(&dev->readtimer, cadet_handler, (unsigned long)dev); dev->readtimer.expires = jiffies + msecs_to_jiffies(50); add_timer(&dev->readtimer); }