pinctrl: stmfx: fix null pointer on remove
Subsystems (3)
PATCH 1/1 pinctrl: stmfx: fix null pointer on remove
dev_get_platdata(&pdev->dev) returns a pointer on struct stmfx_pinctrl, not on struct stmfx (platform_set_drvdata(pdev, pctl); in probe). Pointer on struct stmfx is stored in driver data of pdev parent (in probe:
struct stmfx *stmfx = dev_get_drvdata(pdev->dev.parent);).
Fixes 1490d9f841b1 ("pinctrl: Add STMFX GPIO expander Pinctrl/GPIO driver")
Signed-off-by Amelie Delaunay <[email protected]>
--- drivers/pinctrl/pinctrl-stmfx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/pinctrl-stmfx.c +1 -1
@@ -705,7 +705,7 @@ static int stmfx_pinctrl_probe(struct platform_device *pdev)static int stmfx_pinctrl_remove (struct platform_device *pdev) { -struct stmfx *stmfx =dev_get_platdata (&pdev->dev); +struct stmfx *stmfx =dev_get_drvdata (pdev->dev.parent); return stmfx_function_disable(stmfx, STMFX_FUNC_GPIO |
Signature · 7 lines
2.17.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 7 lines · Amelie Delaunay
dev_get_platdata(&pdev->dev)returns a pointer on structstmfx_pinctrl, not on struct stmfx (platform_set_drvdata(pdev, pctl); in probe). Pointer on struct stmfx is stored in driver data of pdev parent (in probe:
struct stmfx *stmfx =dev_get_drvdata(pdev->dev.parent);).Fixes 1490d9f841b1 ("pinctrl: Add STMFX GPIO expander Pinctrl/GPIO driver")Signed-off-by Amelie Delaunay <[email protected]>
Patch applied for fixes.
Yours,
Linus Walleij