From patchwork Wed Nov 9 19:09:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 124661 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 30E33B6F8B for ; Thu, 10 Nov 2011 06:12:08 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1RODWP-0003pl-E7; Wed, 09 Nov 2011 19:09:17 +0000 Received: from va3ehsobe004.messaging.microsoft.com ([216.32.180.14] helo=VA3EHSOBE004.bigfish.com) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1RODWN-0003pU-3s for linux-arm-kernel@lists.infradead.org; Wed, 09 Nov 2011 19:09:15 +0000 Received: from mail48-va3-R.bigfish.com (10.7.14.243) by VA3EHSOBE004.bigfish.com (10.7.40.24) with Microsoft SMTP Server id 14.1.225.22; Wed, 9 Nov 2011 19:08:49 +0000 Received: from mail48-va3 (localhost [127.0.0.1]) by mail48-va3-R.bigfish.com (Postfix) with ESMTP id AFBD56001D2; Wed, 9 Nov 2011 19:09:01 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h839h62h) X-Spam-TCS-SCL: 1:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail48-va3 (localhost.localdomain [127.0.0.1]) by mail48-va3 (MessageSwitch) id 1320865741551876_19284; Wed, 9 Nov 2011 19:09:01 +0000 (UTC) Received: from VA3EHSMHS002.bigfish.com (unknown [10.7.14.237]) by mail48-va3.bigfish.com (Postfix) with ESMTP id 806986E022F; Wed, 9 Nov 2011 19:09:01 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by VA3EHSMHS002.bigfish.com (10.7.99.12) with Microsoft SMTP Server (TLS) id 14.1.225.22; Wed, 9 Nov 2011 19:08:44 +0000 Received: from az33smr02.freescale.net (10.64.34.200) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server id 14.1.339.2; Wed, 9 Nov 2011 13:09:06 -0600 Received: from fabio-Latitude-E6410.am.freescale.net ([10.29.240.188]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id pA9J94qu021456; Wed, 9 Nov 2011 13:09:04 -0600 (CST) From: Fabio Estevam To: Subject: [PATCH] ARM: mx28evk: Simplify GPIO requests for mx28evk_fec_reset Date: Wed, 9 Nov 2011 17:09:02 -0200 Message-ID: <1320865742-16768-1-git-send-email-fabio.estevam@freescale.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-Spam-Note: CRM114 invocation failed X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [216.32.180.14 listed in list.dnswl.org] Cc: Fabio Estevam , shawn.guo@freescale.com, kernel@pengutronix.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Simplify GPIO requests inside mx28evk_fec_reset by using gpio_request_array. Signed-off-by: Fabio Estevam --- arch/arm/mach-mxs/mach-mx28evk.c | 29 ++++++++--------------------- 1 files changed, 8 insertions(+), 21 deletions(-) diff --git a/arch/arm/mach-mxs/mach-mx28evk.c b/arch/arm/mach-mxs/mach-mx28evk.c index ac2316d..c565c33 100644 --- a/arch/arm/mach-mxs/mach-mx28evk.c +++ b/arch/arm/mach-mxs/mach-mx28evk.c @@ -219,6 +219,11 @@ static const struct gpio_led_platform_data mx28evk_led_data __initconst = { .num_leds = ARRAY_SIZE(mx28evk_leds), }; +static struct gpio mx28evk_fec_gpios[] = { + { MX28EVK_FEC_PHY_POWER, GPIOF_OUT_INIT_LOW, "fec-power" }, + { MX28EVK_FEC_PHY_RESET, GPIOF_OUT_INIT_LOW, "fec-enable" }, +}; + /* fec */ static void __init mx28evk_fec_reset(void) { @@ -231,28 +236,10 @@ static void __init mx28evk_fec_reset(void) clk_enable(clk); /* Power up fec phy */ - ret = gpio_request(MX28EVK_FEC_PHY_POWER, "fec-phy-power"); - if (ret) { - pr_err("Failed to request gpio fec-phy-%s: %d\n", "power", ret); - return; - } - - ret = gpio_direction_output(MX28EVK_FEC_PHY_POWER, 0); - if (ret) { - pr_err("Failed to drive gpio fec-phy-%s: %d\n", "power", ret); - return; - } - - /* Reset fec phy */ - ret = gpio_request(MX28EVK_FEC_PHY_RESET, "fec-phy-reset"); - if (ret) { - pr_err("Failed to request gpio fec-phy-%s: %d\n", "reset", ret); - return; - } - - gpio_direction_output(MX28EVK_FEC_PHY_RESET, 0); + ret = gpio_request_array(mx28evk_fec_gpios, + ARRAY_SIZE(mx28evk_fec_gpios)); if (ret) { - pr_err("Failed to drive gpio fec-phy-%s: %d\n", "reset", ret); + pr_err("Failed to request FEC gpios: %d\n", ret); return; }