mfd: tps65090: print error message when malloc failed
Laxman Dewangan [Thu, 2 Aug 2012 15:12:19 +0000 (20:12 +0530)]
Prints error message when memory alloc failed for easing
debugging.

Change-Id: I6a8ae68702b01ec975f0130ee78aae3c9ac89c1b
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/120845

drivers/mfd/tps65090.c

index 1741664..1071f6c 100644 (file)
@@ -225,10 +225,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->dev = &client->dev;
        i2c_set_clientdata(client, tps65090);