aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2012-11-04 21:34:52 +0000
committerDavid S. Miller <davem@davemloft.net>2012-11-06 17:41:42 -0500
commitdea09247b46687ff6e46fc4b50988537d01c8e64 (patch)
treecb2fdfb6cf503fef70479558cfc1582a16fd2265
parent96f6360c5a0c20fd3e006c3030aac0d1addbe3d9 (diff)
net: at91_ether: add pinctrl support
If no pinctrl available just report a warning as some architecture may not need to do anything. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Tested-by: Joachim Eastwood <manabian@gmail.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/cadence/at91_ether.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
index 039e7ef6c50..6eb928ea276 100644
--- a/drivers/net/ethernet/cadence/at91_ether.c
+++ b/drivers/net/ethernet/cadence/at91_ether.c
@@ -34,6 +34,7 @@
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_net.h>
+#include <linux/pinctrl/consumer.h>
#include "macb.h"
@@ -501,11 +502,21 @@ static int __init at91ether_probe(struct platform_device *pdev)
struct phy_device *phydev;
struct macb *lp;
int res;
+ struct pinctrl *pinctrl;
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!regs)
return -ENOENT;
+ pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+ if (IS_ERR(pinctrl)) {
+ res = PTR_ERR(pinctrl);
+ if (res == -EPROBE_DEFER)
+ return res;
+
+ dev_warn(&pdev->dev, "No pinctrl provided\n");
+ }
+
dev = alloc_etherdev(sizeof(struct macb));
if (!dev)
return -ENOMEM;