Skip to content

Commit

Permalink
pinctrl: ish-pfc: Use devm_pinctrl_register() for pinctrl registration
Browse files Browse the repository at this point in the history
Use devm_pinctrl_register() for pin control registration.

Signed-off-by: Laxman Dewangan <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: [email protected]
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
ldewangan authored and linusw committed Apr 20, 2016
1 parent 9ed19e0 commit 67ec8d7
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 15 deletions.
1 change: 0 additions & 1 deletion drivers/pinctrl/sh-pfc/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,6 @@ static int sh_pfc_remove(struct platform_device *pdev)
#ifdef CONFIG_PINCTRL_SH_PFC_GPIO
sh_pfc_unregister_gpiochip(pfc);
#endif
sh_pfc_unregister_pinctrl(pfc);

return 0;
}
Expand Down
2 changes: 0 additions & 2 deletions drivers/pinctrl/sh-pfc/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,12 @@ struct sh_pfc {
struct sh_pfc_chip *func;
#endif

struct sh_pfc_pinctrl *pinctrl;
};

int sh_pfc_register_gpiochip(struct sh_pfc *pfc);
int sh_pfc_unregister_gpiochip(struct sh_pfc *pfc);

int sh_pfc_register_pinctrl(struct sh_pfc *pfc);
int sh_pfc_unregister_pinctrl(struct sh_pfc *pfc);

u32 sh_pfc_read_raw_reg(void __iomem *mapped_reg, unsigned int reg_width);
void sh_pfc_write_raw_reg(void __iomem *mapped_reg, unsigned int reg_width,
Expand Down
13 changes: 1 addition & 12 deletions drivers/pinctrl/sh-pfc/pinctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,6 @@ int sh_pfc_register_pinctrl(struct sh_pfc *pfc)
return -ENOMEM;

pmx->pfc = pfc;
pfc->pinctrl = pmx;

ret = sh_pfc_map_pins(pfc, pmx);
if (ret < 0)
Expand All @@ -803,19 +802,9 @@ int sh_pfc_register_pinctrl(struct sh_pfc *pfc)
pmx->pctl_desc.pins = pmx->pins;
pmx->pctl_desc.npins = pfc->info->nr_pins;

pmx->pctl = pinctrl_register(&pmx->pctl_desc, pfc->dev, pmx);
pmx->pctl = devm_pinctrl_register(pfc->dev, &pmx->pctl_desc, pmx);
if (IS_ERR(pmx->pctl))
return PTR_ERR(pmx->pctl);

return 0;
}

int sh_pfc_unregister_pinctrl(struct sh_pfc *pfc)
{
struct sh_pfc_pinctrl *pmx = pfc->pinctrl;

pinctrl_unregister(pmx->pctl);

pfc->pinctrl = NULL;
return 0;
}

0 comments on commit 67ec8d7

Please sign in to comment.