mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 22:21:42 +00:00
power: supply: rk817: check correct variable
This code checks "->chg_ps" twice when it was supposed to check
"->bat_ps".
Fixes: 11cb8da018
("power: supply: Add charger driver for Rockchip RK817")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
parent
9abf2313ad
commit
172c65e673
@ -1116,14 +1116,12 @@ static int rk817_charger_probe(struct platform_device *pdev)
|
||||
|
||||
charger->bat_ps = devm_power_supply_register(&pdev->dev,
|
||||
&rk817_bat_desc, &pscfg);
|
||||
|
||||
charger->chg_ps = devm_power_supply_register(&pdev->dev,
|
||||
&rk817_chg_desc, &pscfg);
|
||||
|
||||
if (IS_ERR(charger->chg_ps))
|
||||
if (IS_ERR(charger->bat_ps))
|
||||
return dev_err_probe(dev, -EINVAL,
|
||||
"Battery failed to probe\n");
|
||||
|
||||
charger->chg_ps = devm_power_supply_register(&pdev->dev,
|
||||
&rk817_chg_desc, &pscfg);
|
||||
if (IS_ERR(charger->chg_ps))
|
||||
return dev_err_probe(dev, -EINVAL,
|
||||
"Charger failed to probe\n");
|
||||
|
Loading…
Reference in New Issue
Block a user