summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorBalaji T K <balajitk@ti.com>2014-02-28 19:08:18 +0530
committerChris Ball <chris@printf.net>2014-03-04 11:45:02 -0500
commit19df45bcd7d153b1c7140e7dbe885a55ddcb3449 (patch)
tree0ee17f405baeac77077a7a02d41a5e9eced3a767 /drivers/mmc
parent2cf171cb2579e82f3d587e8ea438afb2b78ddff2 (diff)
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: Balaji T K <balajitk@ti.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Chris Ball <chris@printf.net>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/omap_hsmmc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index cc7e84f28c18..f4e5a59a84c0 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -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