diff mbox

power_supply: tps65217-charger: fix missing platform_set_drvdata()

Message ID 1469544544-31749-1-git-send-email-weiyj.lk@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Wei Yongjun July 26, 2016, 2:49 p.m. UTC
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.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
---
 drivers/power/tps65217_charger.c | 1 +
 1 file changed, 1 insertion(+)

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Sebastian Reichel Aug. 15, 2016, 9:11 p.m. UTC | #1
Hi,

On Tue, Jul 26, 2016 at 02:49:04PM +0000, Wei Yongjun wrote:
> 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.
> 
> Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>

Thanks, queued into power-supply's -fixes branch.

-- Sebastian
diff mbox

Patch

diff --git a/drivers/power/tps65217_charger.c b/drivers/power/tps65217_charger.c
index 73dfae4..4c56e54 100644
--- a/drivers/power/tps65217_charger.c
+++ b/drivers/power/tps65217_charger.c
@@ -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;