From a453f3693f2aa9ebba623f8cff1e3d7c5df96ddd Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Tue, 23 May 2017 20:36:53 +0200 Subject: [PATCH] pinctrl: samsung: Explicitly cast pointer returned by of_iomap() to iomem For S5Pv210 retention control, the driver stores the iomem pointer from of_iomap() under a void pointer member. This makes sparse unhappy: drivers/pinctrl/samsung/pinctrl-exynos.c:664:36: warning: incorrect type in argument 1 (different address spaces) drivers/pinctrl/samsung/pinctrl-exynos.c:664:36: expected void const volatile [noderef] *addr drivers/pinctrl/samsung/pinctrl-exynos.c:664:36: got void * The iomem pointer is used safely (stored under priv by s5pv210_retention_init(), used by s5pv210_retention_disable()) thus we can add explicit casts to iomem to silence the warning. Signed-off-by: Krzysztof Kozlowski --- drivers/pinctrl/samsung/pinctrl-exynos-arm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/samsung/pinctrl-exynos-arm.c b/drivers/pinctrl/samsung/pinctrl-exynos-arm.c index 62e1cc376e2e..071084d3ee9c 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos-arm.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos-arm.c @@ -47,7 +47,7 @@ static const struct samsung_pin_bank_type bank_type_alive = { static void s5pv210_retention_disable(struct samsung_pinctrl_drv_data *drvdata) { - void *clk_base = drvdata->retention_ctrl->priv; + void __iomem *clk_base = (void __iomem *)drvdata->retention_ctrl->priv; u32 tmp; tmp = __raw_readl(clk_base + S5P_OTHERS); @@ -62,7 +62,7 @@ s5pv210_retention_init(struct samsung_pinctrl_drv_data *drvdata, { struct samsung_retention_ctrl *ctrl; struct device_node *np; - void *clk_base; + void __iomem *clk_base; ctrl = devm_kzalloc(drvdata->dev, sizeof(*ctrl), GFP_KERNEL); if (!ctrl) @@ -81,7 +81,7 @@ s5pv210_retention_init(struct samsung_pinctrl_drv_data *drvdata, return ERR_PTR(-EINVAL); } - ctrl->priv = clk_base; + ctrl->priv = (void __force *)clk_base; ctrl->disable = s5pv210_retention_disable; return ctrl; -- 2.20.1