summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Travkin <nikita@trvn.ru>2024-06-05 18:53:27 +0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-08-14 15:34:02 +0200
commit3c5d0871b0af0184abc6f7f52f8705b39a6251ae (patch)
treecbe6f119295e6337abdb96fe39606f43807838e3
parent3e82abbb5539360e6ce456871243d19e089df138 (diff)
downloadlinux-stable-3c5d0871b0af0184abc6f7f52f8705b39a6251ae.tar.gz
linux-stable-3c5d0871b0af0184abc6f7f52f8705b39a6251ae.tar.bz2
linux-stable-3c5d0871b0af0184abc6f7f52f8705b39a6251ae.zip
power: supply: rt5033: Bring back i2c_set_clientdata
[ Upstream commit d3911f1639e67fc7b12aae0efa5a540976d7443b ] Commit 3a93da231c12 ("power: supply: rt5033: Use devm_power_supply_register() helper") reworked the driver to use devm. While at it, the i2c_set_clientdata was dropped along with the remove callback. Unfortunately other parts of the driver also rely on i2c clientdata so this causes kernel oops. Bring the call back to fix the driver. Fixes: 3a93da231c12 ("power: supply: rt5033: Use devm_power_supply_register() helper") Tested-by: Raymond Hackley <raymondhackley@protonmail.com> Signed-off-by: Nikita Travkin <nikita@trvn.ru> Link: https://lore.kernel.org/r/20240605-rt5033-null-clientdata-v1-1-558d710eeb4d@trvn.ru Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/power/supply/rt5033_battery.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/power/supply/rt5033_battery.c b/drivers/power/supply/rt5033_battery.c
index 32eafe2c00af..7a27b262fb84 100644
--- a/drivers/power/supply/rt5033_battery.c
+++ b/drivers/power/supply/rt5033_battery.c
@@ -159,6 +159,7 @@ static int rt5033_battery_probe(struct i2c_client *client)
return -EINVAL;
}
+ i2c_set_clientdata(client, battery);
psy_cfg.of_node = client->dev.of_node;
psy_cfg.drv_data = battery;