diff mbox

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

Message ID 1458761316-11706-1-git-send-email-afenkart@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andreas Fenkart March 23, 2016, 7:28 p.m. UTC
keystone_defconfig can be compiled without PINCTRL support

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

Comments

Dan Carpenter March 23, 2016, 8:10 p.m. UTC | #1
On Wed, Mar 23, 2016 at 08:28:36PM +0100, Andreas Fenkart wrote:
> keystone_defconfig can be compiled without PINCTRL support
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Andreas Fenkart <afenkart@gmail.com>

Just add a depend or a select in the Kconfig.

regards,
dan carpenter

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

Patch

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,