diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2012-11-20 04:14:46 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-11-21 16:07:51 +0100 |
commit | e8e6f047e666a1682b59e52637a7acaa8a0b4c89 (patch) | |
tree | c9596079e6a14908355f4eba42448becc720b323 /drivers/mfd/tps65090.c | |
parent | mfd: Add battery charger in tps65090 sub devs (diff) | |
download | linux-e8e6f047e666a1682b59e52637a7acaa8a0b4c89.tar.xz linux-e8e6f047e666a1682b59e52637a7acaa8a0b4c89.zip |
mfd: tps65090: Add error prints when mem alloc failed
Add error prints when memory allocation failed for
tps65090 data. Also cleanups the melloc arguments.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to '')
-rw-r--r-- | drivers/mfd/tps65090.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/mfd/tps65090.c b/drivers/mfd/tps65090.c index 9b79d6811cae..f95f7f6b846c 100644 --- a/drivers/mfd/tps65090.c +++ b/drivers/mfd/tps65090.c @@ -263,10 +263,11 @@ static int __devinit tps65090_i2c_probe(struct i2c_client *client, return -EINVAL; } - tps65090 = devm_kzalloc(&client->dev, sizeof(struct tps65090), - GFP_KERNEL); - if (tps65090 == NULL) + tps65090 = devm_kzalloc(&client->dev, sizeof(*tps65090), GFP_KERNEL); + if (!tps65090) { + dev_err(&client->dev, "mem alloc for tps65090 failed\n"); return -ENOMEM; + } tps65090->client = client; tps65090->dev = &client->dev; |