Skip to contentSkip to conversation

mmc: host: omap_hsmmc: checking for NULL instead of IS_ERR()

PATCH Applied Dan Carpenter 3 participants 3 messages Apr 10, 2017 – Apr 12, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: host: omap_hsmmc: checking for NULL instead of IS_ERR()

devm_pinctrl_get() returns error pointers, it never returns NULL.

Fixes 455e5cd6f736 ("mmc: omap_hsmmc: Pin remux workaround to support SDIO interrupt on AM335x")
drivers/mmc/host/omap_hsmmc.c +2 -2
index bf64cf23aa59..8c39dccacf39 100644
@@ -1761,8 +1761,8 @@ static int omap_hsmmc_configure_wake_irq(struct omap_hsmmc_host *host)
 	 */
 	if (host->pdata->controller_flags & OMAP_HSMMC_SWAKEUP_MISSING) {
 		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))) {
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Dan Carpenter

devm_pinctrl_get() returns error pointers, it never returns NULL.

Fixes 455e5cd6f736 ("mmc: omap_hsmmc: Pin remux workaround to support SDIO interrupt on AM335x")

FWIW:

Quoted 17 lines
drivers/mmc/host/omap_hsmmc.c +2 -2
index bf64cf23aa59..8c39dccacf39 100644
@@ -1761,8 +1761,8 @@ static int omap_hsmmc_configure_wake_irq(struct omap_hsmmc_host *host)
 	 */
 	if (host->pdata->controller_flags & OMAP_HSMMC_SWAKEUP_MISSING) {
 		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))) {
Applied
#2 lore raw
In reply to Dan Carpenter
Quoted 4 lines · Dan Carpenter

devm_pinctrl_get() returns error pointers, it never returns NULL.

Fixes 455e5cd6f736 ("mmc: omap_hsmmc: Pin remux workaround to support SDIO interrupt on AM335x")

Thanks, applied for next!

Kind regards
Uffe

Quoted 16 lines
drivers/mmc/host/omap_hsmmc.c +2 -2
index bf64cf23aa59..8c39dccacf39 100644
@@ -1761,8 +1761,8 @@ static int omap_hsmmc_configure_wake_irq(struct omap_hsmmc_host *host)
         */
        if (host->pdata->controller_flags & OMAP_HSMMC_SWAKEUP_MISSING) {
                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))) {