Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dea09247 authored by Jean-Christophe PLAGNIOL-VILLARD's avatar Jean-Christophe PLAGNIOL-VILLARD Committed by David S. Miller
Browse files

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: default avatarJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Tested-by: default avatarJoachim Eastwood <manabian@gmail.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: netdev@vger.kernel.org
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 96f6360c
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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;