From patchwork Wed Nov 9 20:36:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 124696 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 EDCFD1007DB for ; Thu, 10 Nov 2011 07:40:14 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1ROEtZ-0000sf-Nv; Wed, 09 Nov 2011 20:37:17 +0000 Received: from mail-yx0-f177.google.com ([209.85.213.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1ROEtW-0000sa-U5 for linux-arm-kernel@lists.infradead.org; Wed, 09 Nov 2011 20:37:15 +0000 Received: by yenl9 with SMTP id l9so1308373yen.36 for ; Wed, 09 Nov 2011 12:37:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; bh=fLlOt6r5VQaFVr0E7HJ/hpyRXuBIWxpMY8RjZ/zW8y8=; b=Fy+tiidCGIKcoIOKVZrHJ2c6iJUv09D8LQ1Tfwju26EbjQV/2p9bRGYF3PY3ZsT2FM 9iALrqzNsjWrOeKWoU0j/0OT+SbY+++9EeWXvLuR9f/0WHEquyjRVGjexGwbL1s2DuiP 4KDidcrkm8o6hq6IeNGi+AiHJlNtISiXn3jak= Received: by 10.146.68.21 with SMTP id q21mr1785173yaa.32.1320871008213; Wed, 09 Nov 2011 12:36:48 -0800 (PST) Received: from localhost.localdomain ([187.106.61.185]) by mx.google.com with ESMTPS id o64sm9040469yhk.3.2011.11.09.12.36.45 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Nov 2011 12:36:47 -0800 (PST) From: Fabio Estevam To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2] ARM: mx28evk: Simplify GPIO requests for mx28evk_fec_reset Date: Wed, 9 Nov 2011 18:36:38 -0200 Message-Id: <1320870998-6200-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.7.1 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -0.8 (/) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-0.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.213.177 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (festevam[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Fabio Estevam , shawn.guo@freescale.com, kernel@pengutronix.de, u.kleine-koenig@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: , MIME-Version: 1.0 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 From: Fabio Estevam Simplify GPIO requests inside mx28evk_fec_reset by using gpio_request_array. Signed-off-by: Fabio Estevam Acked-by: Uwe Kleine-König --- Changes since v1: - Make mx28evk_fec_gpios const 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 const struct gpio mx28evk_fec_gpios[] __initconst = { + { 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; }