[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <75c45d93a92ba4cc18c03dee607d543dc3b766b2.1351690694.git.nicolas.ferre@atmel.com>
Date: Wed, 31 Oct 2012 17:04:59 +0100
From: Nicolas Ferre <nicolas.ferre@...el.com>
To: <netdev@...r.kernel.org>, <davem@...emloft.net>,
<havard@...nnemoen.net>
CC: <bhutchings@...arflare.com>,
<linux-arm-kernel@...ts.infradead.org>, <plagnioj@...osoft.com>,
<patrice.vilchez@...el.com>, <linux-kernel@...r.kernel.org>,
<manabian@...il.com>, <David.Laight@...LAB.COM>,
Nicolas Ferre <nicolas.ferre@...el.com>
Subject: [PATCH v4 10/10] net/macb: add pinctrl consumer support
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@...osoft.com>
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@...osoft.com>
[nicolas.ferre@...el.com: adapt the error path, remove unneeded headers]
Signed-off-by: Nicolas Ferre <nicolas.ferre@...el.com>
Tested-by: Joachim Eastwood <manabian@...il.com>
---
drivers/net/ethernet/cadence/macb.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index c1f20b0..c374875 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -26,6 +26,7 @@
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_net.h>
+#include <linux/pinctrl/consumer.h>
#include "macb.h"
@@ -1472,6 +1473,7 @@ static int __init macb_probe(struct platform_device *pdev)
struct phy_device *phydev;
u32 config;
int err = -ENXIO;
+ struct pinctrl *pinctrl;
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!regs) {
@@ -1479,6 +1481,15 @@ static int __init macb_probe(struct platform_device *pdev)
goto err_out;
}
+ pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+ if (IS_ERR(pinctrl)) {
+ err = PTR_ERR(pinctrl);
+ if (err == -EPROBE_DEFER)
+ goto err_out;
+
+ dev_warn(&pdev->dev, "No pinctrl provided\n");
+ }
+
err = -ENOMEM;
dev = alloc_etherdev(sizeof(*bp));
if (!dev)
--
1.8.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists