[PATCH v2] mmc: omap_hsmmc: devm_pinctrl_get returns ERR_PTR upon error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



keystone_defconfig can be compiled without PINCTRL support

Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Signed-off-by: Andreas Fenkart <afenkart@xxxxxxxxx>
---
 drivers/mmc/host/omap_hsmmc.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 62e421a..ecf3db8 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1841,9 +1841,14 @@ static int omap_hsmmc_configure_wake_irq(struct omap_hsmmc_host *host)
 	 * and need to remux SDIO DAT1 to GPIO for wake-up from idle.
 	 */
 	if (host->pdata->controller_flags & OMAP_HSMMC_SWAKEUP_MISSING) {
+#ifndef CONFIG_PINCTRL
+		dev_info(host->dev, "missing pinctrl support\n");
+		ret = -ENODEV;
+		goto err_free_irq;
+#else
 		struct pinctrl *p = devm_pinctrl_get(host->dev);
-		if (!p) {
-			ret = -ENODEV;
+		if (IS_ERR(p)) {
+			ret = PTR_ERR(p);
 			goto err_free_irq;
 		}
 		if (IS_ERR(pinctrl_lookup_state(p, PINCTRL_STATE_DEFAULT))) {
@@ -1860,6 +1865,7 @@ static int omap_hsmmc_configure_wake_irq(struct omap_hsmmc_host *host)
 			goto err_free_irq;
 		}
 		devm_pinctrl_put(p);
+#endif
 	}
 
 	OMAP_HSMMC_WRITE(host->base, HCTL,
-- 
2.7.0

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux