Skip to content

Commit

Permalink
pinctrl: stm32: 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: Maxime Coquelin <[email protected]>
Cc: Patrice Chotard <[email protected]>
Acked-by: Maxime Coquelin <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
ldewangan authored and linusw committed Apr 20, 2016
1 parent d39de31 commit 88edad0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/pinctrl/stm32/pinctrl-stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -813,10 +813,11 @@ int stm32_pctl_probe(struct platform_device *pdev)
pctl->pctl_desc.pmxops = &stm32_pmx_ops;
pctl->dev = &pdev->dev;

pctl->pctl_dev = pinctrl_register(&pctl->pctl_desc, &pdev->dev, pctl);
if (!pctl->pctl_dev) {
pctl->pctl_dev = devm_pinctrl_register(&pdev->dev, &pctl->pctl_desc,
pctl);
if (IS_ERR(pctl->pctl_dev)) {
dev_err(&pdev->dev, "Failed pinctrl registration\n");
return -EINVAL;
return PTR_ERR(pctl->pctl_dev);
}

for (i = 0; i < pctl->nbanks; i++)
Expand Down

0 comments on commit 88edad0

Please sign in to comment.