diff options
| author | Shawn Guo <shawn.guo@linaro.org> | 2012-05-06 08:24:04 -0400 |
|---|---|---|
| committer | Shawn Guo <shawn.guo@linaro.org> | 2012-05-11 21:42:47 -0400 |
| commit | b2bccee1793ebcf47272fc6556e741a9fba896c7 (patch) | |
| tree | aeb70e4a57d5670b538219683c5ed3c6db3bd410 /drivers/net/ethernet | |
| parent | fed78ce4c6af1c0d516ae6f4cdc2bb8dbbca8c22 (diff) | |
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')
| -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 @@ | |||
| 48 | #include <linux/of_device.h> | 48 | #include <linux/of_device.h> |
| 49 | #include <linux/of_gpio.h> | 49 | #include <linux/of_gpio.h> |
| 50 | #include <linux/of_net.h> | 50 | #include <linux/of_net.h> |
| 51 | #include <linux/pinctrl/consumer.h> | ||
| 51 | 52 | ||
| 52 | #include <asm/cacheflush.h> | 53 | #include <asm/cacheflush.h> |
| 53 | 54 | ||
| @@ -1542,6 +1543,7 @@ fec_probe(struct platform_device *pdev) | |||
| 1542 | struct resource *r; | 1543 | struct resource *r; |
| 1543 | const struct of_device_id *of_id; | 1544 | const struct of_device_id *of_id; |
| 1544 | static int dev_id; | 1545 | static int dev_id; |
| 1546 | struct pinctrl *pinctrl; | ||
| 1545 | 1547 | ||
| 1546 | of_id = of_match_device(fec_dt_ids, &pdev->dev); | 1548 | of_id = of_match_device(fec_dt_ids, &pdev->dev); |
| 1547 | if (of_id) | 1549 | if (of_id) |
| @@ -1609,6 +1611,12 @@ fec_probe(struct platform_device *pdev) | |||
| 1609 | } | 1611 | } |
| 1610 | } | 1612 | } |
| 1611 | 1613 | ||
| 1614 | pinctrl = devm_pinctrl_get_select_default(&pdev->dev); | ||
| 1615 | if (IS_ERR(pinctrl)) { | ||
| 1616 | ret = PTR_ERR(pinctrl); | ||
| 1617 | goto failed_pin; | ||
| 1618 | } | ||
| 1619 | |||
| 1612 | fep->clk = clk_get(&pdev->dev, NULL); | 1620 | fep->clk = clk_get(&pdev->dev, NULL); |
| 1613 | if (IS_ERR(fep->clk)) { | 1621 | if (IS_ERR(fep->clk)) { |
| 1614 | ret = PTR_ERR(fep->clk); | 1622 | ret = PTR_ERR(fep->clk); |
| @@ -1639,6 +1647,7 @@ failed_mii_init: | |||
| 1639 | failed_init: | 1647 | failed_init: |
| 1640 | clk_disable_unprepare(fep->clk); | 1648 | clk_disable_unprepare(fep->clk); |
| 1641 | clk_put(fep->clk); | 1649 | clk_put(fep->clk); |
| 1650 | failed_pin: | ||
| 1642 | failed_clk: | 1651 | failed_clk: |
| 1643 | for (i = 0; i < FEC_IRQ_NUM; i++) { | 1652 | for (i = 0; i < FEC_IRQ_NUM; i++) { |
| 1644 | irq = platform_get_irq(pdev, i); | 1653 | irq = platform_get_irq(pdev, i); |
