diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2012-05-06 20:24:04 +0800 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2012-05-12 09:42:47 +0800 |
commit | b2bccee1793ebcf47272fc6556e741a9fba896c7 (patch) | |
tree | aeb70e4a57d5670b538219683c5ed3c6db3bd410 /drivers/net/ethernet/freescale/fec.c | |
parent | fed78ce4c6af1c0d516ae6f4cdc2bb8dbbca8c22 (diff) | |
download | linux-b2bccee1793ebcf47272fc6556e741a9fba896c7.tar.gz linux-b2bccee1793ebcf47272fc6556e741a9fba896c7.tar.bz2 linux-b2bccee1793ebcf47272fc6556e741a9fba896c7.zip |
net: fec: adopt pinctrl support
Cc: netdev@vger.kernel.org
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Dong Aisheng <dong.aisheng@linaro.org>
Acked-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale/fec.c')
-rw-r--r-- | 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 a12b3f5bc025..500c106af86e 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); |