power: supply: rt5033_battery: Fix error code in rt5033_battery_probe()
authorPeng Fan <fanpeng@loongson.cn>
Thu, 2 Jul 2020 08:58:52 +0000 (16:58 +0800)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Tue, 28 Jul 2020 00:18:24 +0000 (02:18 +0200)
In the function rt5033_battery_probe(), it should return -ENOMEM
instead of -EINVAL when call function devm_kzalloc() failed.

Signed-off-by: Peng Fan <fanpeng@loongson.cn>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/rt5033_battery.c

index d8667a9fc49b1ba1ebcdb329b62c219e432e6c07..f330452341f02953189d3328c830c21160d68e95 100644 (file)
@@ -125,7 +125,7 @@ static int rt5033_battery_probe(struct i2c_client *client,
 
        battery = devm_kzalloc(&client->dev, sizeof(*battery), GFP_KERNEL);
        if (!battery)
-               return -EINVAL;
+               return -ENOMEM;
 
        battery->client = client;
        battery->regmap = devm_regmap_init_i2c(client,