aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-stmfx.c
diff options
context:
space:
mode:
authorAmelie Delaunay <amelie.delaunay@st.com>2019-10-04 14:23:42 +0200
committerLinus Walleij <linus.walleij@linaro.org>2019-10-05 18:39:09 +0200
commit2fd215b8fdbe4d3a609adbe3a323696393cb1e53 (patch)
treebc4087369f35b8fe5b418d604d0d4fc18f868b2d /drivers/pinctrl/pinctrl-stmfx.c
parentpinctrl: iproc: allow for error from platform_get_irq() (diff)
downloadlinux-dev-2fd215b8fdbe4d3a609adbe3a323696393cb1e53.tar.xz
linux-dev-2fd215b8fdbe4d3a609adbe3a323696393cb1e53.zip
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 <amelie.delaunay@st.com> Link: https://lore.kernel.org/r/20191004122342.22018-1-amelie.delaunay@st.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-stmfx.c')
-rw-r--r--drivers/pinctrl/pinctrl-stmfx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c
index 974973777395..564660028fcc 100644
--- a/drivers/pinctrl/pinctrl-stmfx.c
+++ b/drivers/pinctrl/pinctrl-stmfx.c
@@ -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 |