From: Devendra Naga Date: Sat, 9 Jun 2012 12:02:31 +0000 (+0530) Subject: pinctrl: pinctrl-mxs: set platform driver data to NULL at errpath and at unregister X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=149ff9e1f240e7b57a02e0be5f74f21d0307d1d3;p=linux-beck.git 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. Signed-off-by: Devendra Naga Signed-off-by: Linus Walleij --- diff --git a/drivers/pinctrl/pinctrl-mxs.c b/drivers/pinctrl/pinctrl-mxs.c index 9d46303a84e7..afb50ee64598 100644 --- a/drivers/pinctrl/pinctrl-mxs.c +++ b/drivers/pinctrl/pinctrl-mxs.c @@ -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);