Skip to content

Commit 466bf93

Browse files
ticat123sre
authored andcommitted
power: supply: rt5033_battery: Fix error code in rt5033_battery_probe()
In the function rt5033_battery_probe(), it should return -ENOMEM instead of -EINVAL when call function devm_kzalloc() failed. Signed-off-by: Peng Fan <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 2f38dc4 commit 466bf93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/power/supply/rt5033_battery.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static int rt5033_battery_probe(struct i2c_client *client,
125125

126126
battery = devm_kzalloc(&client->dev, sizeof(*battery), GFP_KERNEL);
127127
if (!battery)
128-
return -EINVAL;
128+
return -ENOMEM;
129129

130130
battery->client = client;
131131
battery->regmap = devm_regmap_init_i2c(client,

0 commit comments

Comments
 (0)