diff mbox

[2/2] mmc: omap_hsmmc: checking for ERR_PTR instead of NULL

Message ID 20140130121548.GB10368@elgon.mountain (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Jan. 30, 2014, 12:15 p.m. UTC
The of_get_hsmmc_pdata() function returns NULL on error, it doesn't
return ERR_PTRs.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
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

Comments

Balaji T K Jan. 30, 2014, 1 p.m. UTC | #1
On Thursday 30 January 2014 05:45 PM, Dan Carpenter wrote:
> The of_get_hsmmc_pdata() function returns NULL on error, it doesn't
> return ERR_PTRs.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index bfb0dbd052c0..76dbc7b759c2 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -1761,9 +1761,8 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
>   	match = of_match_device(of_match_ptr(omap_mmc_of_match), &pdev->dev);
>   	if (match) {
>   		pdata = of_get_hsmmc_pdata(&pdev->dev);
> -
> -		if (IS_ERR(pdata))
> -			return PTR_ERR(pdata);
> +		if (!pdata)
> +			return -ENOMEM;

Thanks for reporting this.
Caller needs to be fixed. I will send a patch to fix this.

>
>   		if (match->data) {
>   			const u16 *offsetp = match->data;
>

--
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 bfb0dbd052c0..76dbc7b759c2 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1761,9 +1761,8 @@  static int omap_hsmmc_probe(struct platform_device *pdev)
 	match = of_match_device(of_match_ptr(omap_mmc_of_match), &pdev->dev);
 	if (match) {
 		pdata = of_get_hsmmc_pdata(&pdev->dev);
-
-		if (IS_ERR(pdata))
-			return PTR_ERR(pdata);
+		if (!pdata)
+			return -ENOMEM;
 
 		if (match->data) {
 			const u16 *offsetp = match->data;