From patchwork Thu Sep 8 07:09:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 3978 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id B2E2F23F9F for ; Thu, 8 Sep 2011 07:00:55 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id A7397A183EE for ; Thu, 8 Sep 2011 07:00:55 +0000 (UTC) Received: by mail-fx0-f52.google.com with SMTP id 18so1863069fxd.11 for ; Thu, 08 Sep 2011 00:00:55 -0700 (PDT) Received: by 10.223.76.201 with SMTP id d9mr583242fak.119.1315465255552; Thu, 08 Sep 2011 00:00:55 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.11.8 with SMTP id m8cs165257lab; Thu, 8 Sep 2011 00:00:55 -0700 (PDT) Received: by 10.68.25.136 with SMTP id c8mr572311pbg.120.1315465254221; Thu, 08 Sep 2011 00:00:54 -0700 (PDT) Received: from VA3EHSOBE005.bigfish.com (va3ehsobe005.messaging.microsoft.com [216.32.180.31]) by mx.google.com with ESMTPS id a3si2673465wfe.23.2011.09.08.00.00.53 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 08 Sep 2011 00:00:54 -0700 (PDT) Received-SPF: neutral (google.com: 216.32.180.31 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) client-ip=216.32.180.31; Authentication-Results: mx.google.com; spf=neutral (google.com: 216.32.180.31 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) smtp.mail=shawn.guo@linaro.org Received: from mail101-va3-R.bigfish.com (10.7.14.242) by VA3EHSOBE005.bigfish.com (10.7.40.25) with Microsoft SMTP Server id 14.1.225.22; Thu, 8 Sep 2011 07:00:52 +0000 Received: from mail101-va3 (localhost.localdomain [127.0.0.1]) by mail101-va3-R.bigfish.com (Postfix) with ESMTP id 44C9D15006A; Thu, 8 Sep 2011 07:00:52 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bh8275dhz2dh87h2a8h668h839h62h) X-Spam-TCS-SCL: 1:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-DOMAIN-IP-MATCH: fail Received: from mail101-va3 (localhost.localdomain [127.0.0.1]) by mail101-va3 (MessageSwitch) id 1315465251829551_14938; Thu, 8 Sep 2011 07:00:51 +0000 (UTC) Received: from VA3EHSMHS011.bigfish.com (unknown [10.7.14.249]) by mail101-va3.bigfish.com (Postfix) with ESMTP id 805E41048056; Thu, 8 Sep 2011 07:00:51 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by VA3EHSMHS011.bigfish.com (10.7.99.21) with Microsoft SMTP Server (TLS) id 14.1.225.22; Thu, 8 Sep 2011 07:00:43 +0000 Received: from az33smr02.freescale.net (10.64.34.200) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server id 14.1.323.7; Thu, 8 Sep 2011 02:00:35 -0500 Received: from S2100-06.ap.freescale.net (S2100-06.ap.freescale.net [10.192.242.125]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id p8870TZN026445; Thu, 8 Sep 2011 02:00:33 -0500 (CDT) From: Shawn Guo To: Ben Dooks CC: , , , , Shawn Guo , Darius Augulis , Ben Dooks Subject: [PATCH REPOST 1/2] i2c-imx: remove init/exit hooks from platform data Date: Thu, 8 Sep 2011 15:09:34 +0800 Message-ID: <1315465775-31335-2-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1315465775-31335-1-git-send-email-shawn.guo@linaro.org> References: <1315465775-31335-1-git-send-email-shawn.guo@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com The init/exit hooks in platform data are being used nowhere, so can be removed. Signed-off-by: Shawn Guo Cc: Darius Augulis Cc: Ben Dooks Acked-by: Grant Likely Acked-by: Sascha Hauer --- arch/arm/plat-mxc/include/mach/i2c.h | 4 ---- drivers/i2c/busses/i2c-imx.c | 21 +++------------------ 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/arch/arm/plat-mxc/include/mach/i2c.h b/arch/arm/plat-mxc/include/mach/i2c.h index 4a5dc5c..375cdd0 100644 --- a/arch/arm/plat-mxc/include/mach/i2c.h +++ b/arch/arm/plat-mxc/include/mach/i2c.h @@ -11,14 +11,10 @@ /** * struct imxi2c_platform_data - structure of platform data for MXC I2C driver - * @init: Initialise gpio's and other board specific things - * @exit: Free everything initialised by @init * @bitrate: Bus speed measured in Hz * **/ struct imxi2c_platform_data { - int (*init)(struct device *dev); - void (*exit)(struct device *dev); int bitrate; }; diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 4c2a62b..54d809e 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -466,7 +466,7 @@ static int __init i2c_imx_probe(struct platform_device *pdev) { struct imx_i2c_struct *i2c_imx; struct resource *res; - struct imxi2c_platform_data *pdata; + struct imxi2c_platform_data *pdata = pdev->dev.platform_data; void __iomem *base; resource_size_t res_size; int irq; @@ -485,19 +485,11 @@ static int __init i2c_imx_probe(struct platform_device *pdev) return -ENOENT; } - pdata = pdev->dev.platform_data; - - if (pdata && pdata->init) { - ret = pdata->init(&pdev->dev); - if (ret) - return ret; - } - res_size = resource_size(res); if (!request_mem_region(res->start, res_size, DRIVER_NAME)) { - ret = -EBUSY; - goto fail0; + dev_err(&pdev->dev, "request_mem_region failed\n"); + return -EBUSY; } base = ioremap(res->start, res_size); @@ -586,9 +578,6 @@ fail2: iounmap(base); fail1: release_mem_region(res->start, resource_size(res)); -fail0: - if (pdata && pdata->exit) - pdata->exit(&pdev->dev); return ret; /* Return error number */ } @@ -611,10 +600,6 @@ static int __exit i2c_imx_remove(struct platform_device *pdev) writeb(0, i2c_imx->base + IMX_I2C_I2CR); writeb(0, i2c_imx->base + IMX_I2C_I2SR); - /* Shut down hardware */ - if (pdata && pdata->exit) - pdata->exit(&pdev->dev); - clk_put(i2c_imx->clk); iounmap(i2c_imx->base);