Skip to contentSkip to conversation

pinctrl: pinctrl-mxs: set platform driver data to NULL at errpath and at unregister

PATCH In review Devendra Naga 2 participants 2 messages Jun 9, 2012 – Jun 12, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 pinctrl: pinctrl-mxs: set platform driver data to NULL at errpath and at unregister

clear the platform data pointer when mxs_pinctrl_probe_dt fails, and also before the unregistering with pinctrl subsystem.

---
 drivers/pinctrl/pinctrl-mxs.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/pinctrl/pinctrl-mxs.c +2 -0
index 9d46303..afb50ee 100644
@@ -516,6 +516,7 @@ int __devinit mxs_pinctrl_probe(struct platform_device *pdev,
 	return 0;
 
 err:
+	platform_set_drvdata(pdev, NULL);
 	iounmap(d->base);
 	return ret;
 }
@@ -525,6 +526,7 @@ int __devexit mxs_pinctrl_remove(struct platform_device *pdev)
 {
 	struct mxs_pinctrl_data *d = platform_get_drvdata(pdev);
 
+	platform_set_drvdata(pdev, NULL);
 	pinctrl_unregister(d->pctl);
 	iounmap(d->base);
 
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 4 lines · Devendra Naga

clear the platform data pointer when mxs_pinctrl_probe_dt fails, and also before the unregistering with pinctrl subsystem.

Applied this as well.

Yours,
Linus Walleij