Commit 19df45bc authored by Balaji T K's avatar Balaji T K Committed by Chris Ball

mmc: omap_hsmmc: fix return error code for of_get_hsmmc_pdata

of_get_hsmmc_pdata returns a pointer, returning NULL is invalid,
return ERR_PTR for error case.
Signed-off-by: default avatarBalaji T K <balajitk@ti.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarChris Ball <chris@printf.net>
parent 2cf171cb
......@@ -1740,7 +1740,7 @@ static struct omap_mmc_platform_data *of_get_hsmmc_pdata(struct device *dev)
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata)
return NULL; /* out of memory */
return ERR_PTR(-ENOMEM); /* out of memory */
if (of_find_property(np, "ti,dual-volt", NULL))
pdata->controller_flags |= OMAP_HSMMC_SUPPORTS_DUAL_VOLT;
......@@ -1781,7 +1781,7 @@ static struct omap_mmc_platform_data *of_get_hsmmc_pdata(struct device *dev)
static inline struct omap_mmc_platform_data
*of_get_hsmmc_pdata(struct device *dev)
{
return NULL;
return ERR_PTR(-EINVAL);
}
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment