mfd: tps65090: Add error prints when mem alloc failed
authorLaxman Dewangan <ldewangan@nvidia.com>
Tue, 20 Nov 2012 03:14:46 +0000 (08:44 +0530)
committerSamuel Ortiz <sameo@linux.intel.com>
Wed, 21 Nov 2012 15:07:51 +0000 (16:07 +0100)
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>
drivers/mfd/tps65090.c

index 9b79d6811cae3c7f673c41a5ec3d442779da8f86..f95f7f6b846ca5a875d8ba2923159e55262c815c 100644 (file)
@@ -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;