Commit b2bccee1 authored by Shawn Guo's avatar Shawn Guo

net: fec: adopt pinctrl support

Cc: netdev@vger.kernel.org
Signed-off-by: default avatarShawn Guo <shawn.guo@linaro.org>
Acked-by: default avatarDong Aisheng <dong.aisheng@linaro.org>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fed78ce4
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/of_gpio.h> #include <linux/of_gpio.h>
#include <linux/of_net.h> #include <linux/of_net.h>
#include <linux/pinctrl/consumer.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
...@@ -1542,6 +1543,7 @@ fec_probe(struct platform_device *pdev) ...@@ -1542,6 +1543,7 @@ fec_probe(struct platform_device *pdev)
struct resource *r; struct resource *r;
const struct of_device_id *of_id; const struct of_device_id *of_id;
static int dev_id; static int dev_id;
struct pinctrl *pinctrl;
of_id = of_match_device(fec_dt_ids, &pdev->dev); of_id = of_match_device(fec_dt_ids, &pdev->dev);
if (of_id) if (of_id)
...@@ -1609,6 +1611,12 @@ fec_probe(struct platform_device *pdev) ...@@ -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); fep->clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(fep->clk)) { if (IS_ERR(fep->clk)) {
ret = PTR_ERR(fep->clk); ret = PTR_ERR(fep->clk);
...@@ -1639,6 +1647,7 @@ fec_probe(struct platform_device *pdev) ...@@ -1639,6 +1647,7 @@ fec_probe(struct platform_device *pdev)
failed_init: failed_init:
clk_disable_unprepare(fep->clk); clk_disable_unprepare(fep->clk);
clk_put(fep->clk); clk_put(fep->clk);
failed_pin:
failed_clk: failed_clk:
for (i = 0; i < FEC_IRQ_NUM; i++) { for (i = 0; i < FEC_IRQ_NUM; i++) {
irq = platform_get_irq(pdev, i); irq = platform_get_irq(pdev, i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment