netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shawn Guo <shawn.guo@linaro.org>
To: linux-arm-kernel@lists.infradead.org
Cc: Arnd Bergmann <arnd@arndb.de>, Olof Johansson <olof@lixom.net>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Dong Aisheng <dong.aisheng@linaro.org>,
	Shawn Guo <shawn.guo@linaro.org>,
	netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>
Subject: [PATCH RESEND 2/5] net: fec: adopt pinctrl support
Date: Mon,  7 May 2012 08:53:57 +0800	[thread overview]
Message-ID: <1336352040-28447-3-git-send-email-shawn.guo@linaro.org> (raw)
In-Reply-To: <1336352040-28447-1-git-send-email-shawn.guo@linaro.org>

Cc: netdev@vger.kernel.org
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/net/ethernet/freescale/fec.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index a12b3f5..500c106 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -48,6 +48,7 @@
 #include <linux/of_device.h>
 #include <linux/of_gpio.h>
 #include <linux/of_net.h>
+#include <linux/pinctrl/consumer.h>
 
 #include <asm/cacheflush.h>
 
@@ -1542,6 +1543,7 @@ fec_probe(struct platform_device *pdev)
 	struct resource *r;
 	const struct of_device_id *of_id;
 	static int dev_id;
+	struct pinctrl *pinctrl;
 
 	of_id = of_match_device(fec_dt_ids, &pdev->dev);
 	if (of_id)
@@ -1609,6 +1611,12 @@ fec_probe(struct platform_device *pdev)
 		}
 	}
 
+	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+	if (IS_ERR(pinctrl)) {
+		ret = PTR_ERR(pinctrl);
+		goto failed_pin;
+	}
+
 	fep->clk = clk_get(&pdev->dev, NULL);
 	if (IS_ERR(fep->clk)) {
 		ret = PTR_ERR(fep->clk);
@@ -1639,6 +1647,7 @@ failed_mii_init:
 failed_init:
 	clk_disable_unprepare(fep->clk);
 	clk_put(fep->clk);
+failed_pin:
 failed_clk:
 	for (i = 0; i < FEC_IRQ_NUM; i++) {
 		irq = platform_get_irq(pdev, i);
-- 
1.7.5.4

  reply	other threads:[~2012-05-07  0:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-07  0:53 [PATCH RESEND 0/5] Adopt pinctrl support for a few outstanding imx drivers Shawn Guo
2012-05-07  0:53 ` Shawn Guo [this message]
2012-05-08  3:44   ` [PATCH RESEND 2/5] net: fec: adopt pinctrl support Dong Aisheng
2012-05-11 22:31   ` David Miller
2012-05-07  6:50 ` [PATCH RESEND 0/5] Adopt pinctrl support for a few outstanding imx drivers Dong Aisheng
2012-05-07  7:34   ` Shawn Guo
2012-05-07  7:53     ` Dong Aisheng
     [not found] ` <1336352040-28447-4-git-send-email-shawn.guo@linaro.org>
2012-05-07  8:06   ` [PATCH RESEND 3/5] can: flexcan: adopt pinctrl support Marc Kleine-Budde
2012-05-07  8:17     ` Shawn Guo
2012-05-07  8:29       ` Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1336352040-28447-3-git-send-email-shawn.guo@linaro.org \
    --to=shawn.guo@linaro.org \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=dong.aisheng@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=netdev@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).