Replace probe-time ioremap_nocache() call with devm_ioremap_nocache()
and get rid of the corresponding iounmap() call.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-static void pfc_iounmap(struct sh_pfc *pfc)
-{
- int k;
-
- for (k = 0; k < pfc->pdata->num_resources; k++)
- if (pfc->window[k].virt)
- iounmap(pfc->window[k].virt);
-}
-
static int pfc_ioremap(struct sh_pfc *pfc)
{
struct resource *res;
static int pfc_ioremap(struct sh_pfc *pfc)
{
struct resource *res;
WARN_ON(resource_type(res) != IORESOURCE_MEM);
pfc->window[k].phys = res->start;
pfc->window[k].size = resource_size(res);
WARN_ON(resource_type(res) != IORESOURCE_MEM);
pfc->window[k].phys = res->start;
pfc->window[k].size = resource_size(res);
- pfc->window[k].virt = ioremap_nocache(res->start,
- resource_size(res));
- if (!pfc->window[k].virt) {
- pfc_iounmap(pfc);
+ pfc->window[k].virt = devm_ioremap_nocache(pfc->dev, res->start,
+ resource_size(res));
+ if (!pfc->window[k].virt)
*/
ret = sh_pfc_register_pinctrl(pfc);
if (unlikely(ret != 0))
*/
ret = sh_pfc_register_pinctrl(pfc);
if (unlikely(ret != 0))
#ifdef CONFIG_GPIO_SH_PFC
/*
#ifdef CONFIG_GPIO_SH_PFC
/*
pr_info("%s support registered\n", pdata->name);
return 0;
pr_info("%s support registered\n", pdata->name);
return 0;
-
-err:
- pfc_iounmap(pfc);
- return ret;
}
static int sh_pfc_remove(struct platform_device *pdev)
}
static int sh_pfc_remove(struct platform_device *pdev)
#endif
sh_pfc_unregister_pinctrl(pfc);
#endif
sh_pfc_unregister_pinctrl(pfc);
platform_set_drvdata(pdev, NULL);
return 0;
platform_set_drvdata(pdev, NULL);
return 0;