Skip to content

Commit

Permalink
power_supply: tps65217-charger: fix missing platform_set_drvdata()
Browse files Browse the repository at this point in the history
Add missing platform_set_drvdata() in tps65217_charger_probe(), otherwise
calling platform_get_drvdata() in remove returns NULL.

This is detected by Coccinelle semantic patch.

Fixes: 3636859 ("power_supply: Add support for tps65217-charger")
Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
  • Loading branch information
Wei Yongjun authored and Sebastian Reichel committed Aug 15, 2016
1 parent bae170e commit 33e7664
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/power/tps65217_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ static int tps65217_charger_probe(struct platform_device *pdev)
if (!charger)
return -ENOMEM;

platform_set_drvdata(pdev, charger);
charger->tps = tps;
charger->dev = &pdev->dev;

Expand Down

0 comments on commit 33e7664

Please sign in to comment.