Skip to content

Commit

Permalink
mfd: tps65090: Add error prints when mem alloc failed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Laxman Dewangan authored and Samuel Ortiz committed Nov 21, 2012
1 parent e2e8ffc commit e8e6f04
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/mfd/tps65090.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e8e6f04

Please sign in to comment.