From: Alan Ott Date: Mon, 18 Mar 2013 12:06:40 +0000 (+0000) Subject: mrf24j40: pinctrl support X-Git-Tag: MMI-PSA29.97-13-9~14469^2~430 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=50861c7effcad107826e49e6077e64b666c2dc3f;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git mrf24j40: pinctrl support Activate pinctrl settings when used with a DT system. Signed-off-by: Alan Ott Signed-off-by: David S. Miller --- diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c index 3f2c7aaf28c4..3106895e8b91 100644 --- a/drivers/net/ieee802154/mrf24j40.c +++ b/drivers/net/ieee802154/mrf24j40.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -623,6 +624,7 @@ static int mrf24j40_probe(struct spi_device *spi) int ret = -ENOMEM; u8 val; struct mrf24j40 *devrec; + struct pinctrl *pinctrl; printk(KERN_INFO "mrf24j40: probe(). IRQ: %d\n", spi->irq); @@ -633,6 +635,11 @@ static int mrf24j40_probe(struct spi_device *spi) if (!devrec->buf) goto err_buf; + pinctrl = devm_pinctrl_get_select_default(&spi->dev); + if (IS_ERR(pinctrl)) + dev_warn(&spi->dev, + "pinctrl pins are not configured from the driver"); + spi->mode = SPI_MODE_0; /* TODO: Is this appropriate for right here? */ if (spi->max_speed_hz > MAX_SPI_SPEED_HZ) spi->max_speed_hz = MAX_SPI_SPEED_HZ;