提交 e8e6f047 编写于 作者: L Laxman Dewangan 提交者: Samuel Ortiz

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: NLaxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 e2e8ffc9
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册