power_supply: tps65217-charger: fix missing platform_set_drvdata()
authorWei Yongjun <weiyj.lk@gmail.com>
Tue, 26 Jul 2016 14:49:04 +0000 (14:49 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Sep 2016 08:18:39 +0000 (10:18 +0200)
commit 33e7664a0af6e9a516f01014f39737aaa119b6d9 upstream.

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: 3636859b280c ("power_supply: Add support for tps65217-charger")
Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/power/tps65217_charger.c

index d9f56730c735819010e9efff4f8499814c7fbe58..040a40b4b173b214fcc89d1760434ed2a2f3f853 100644 (file)
@@ -205,6 +205,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;