Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752350AbbBKKzp (ORCPT ); Wed, 11 Feb 2015 05:55:45 -0500 Received: from mail-pa0-f49.google.com ([209.85.220.49]:40054 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751735AbbBKKzo (ORCPT ); Wed, 11 Feb 2015 05:55:44 -0500 Date: Wed, 11 Feb 2015 16:25:38 +0530 From: Vaishali Thakkar To: Wolfram Sang , Greg Kroah-Hartman Cc: Russell King , Dmitry Eremin-Solenikov , linux-pcmcia@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] pcmcia: Use setup_timer Message-ID: <20150211105538.GA23936@vaishali-Ideapad-Z570> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1809 Lines: 59 This patch introduces the use of function setup_timer. This is done using Coccinelle and semantic patch used is as follows: @@ expression x,y,z; @@ - init_timer (&x); + setup_timer (&x, y, z); - x.function = y; - x.data = z; Signed-off-by: Vaishali Thakkar --- drivers/pcmcia/omap_cf.c | 4 +--- drivers/pcmcia/soc_common.c | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c index 8170102..4e2f501 100644 --- a/drivers/pcmcia/omap_cf.c +++ b/drivers/pcmcia/omap_cf.c @@ -220,9 +220,7 @@ static int __init omap_cf_probe(struct platform_device *pdev) cf = kzalloc(sizeof *cf, GFP_KERNEL); if (!cf) return -ENOMEM; - init_timer(&cf->timer); - cf->timer.function = omap_cf_timer; - cf->timer.data = (unsigned long) cf; + setup_timer(&cf->timer, omap_cf_timer, (unsigned long)cf); cf->pdev = pdev; platform_set_drvdata(pdev, cf); diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c index 933f465..eed5e9c 100644 --- a/drivers/pcmcia/soc_common.c +++ b/drivers/pcmcia/soc_common.c @@ -726,9 +726,8 @@ int soc_pcmcia_add_one(struct soc_pcmcia_socket *skt) { int ret; - init_timer(&skt->poll_timer); - skt->poll_timer.function = soc_common_pcmcia_poll_event; - skt->poll_timer.data = (unsigned long)skt; + setup_timer(&skt->poll_timer, soc_common_pcmcia_poll_event, + (unsigned long)skt); skt->poll_timer.expires = jiffies + SOC_PCMCIA_POLL_PERIOD; ret = request_resource(&iomem_resource, &skt->res_skt); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/