Skip to content

Commit

Permalink
pinctrl: at91: 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 and remove
the need of .remove callback.

Signed-off-by: Laxman Dewangan <[email protected]>
Cc: Jean-Christophe Plagniol-Villard <[email protected]>
Cc: [email protected]
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
ldewangan authored and linusw committed Apr 21, 2016
1 parent 5d3fc88 commit 5c67425
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions drivers/pinctrl/pinctrl-at91.c
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,8 @@ static int at91_pinctrl_probe(struct platform_device *pdev)
}

platform_set_drvdata(pdev, info);
info->pctl = pinctrl_register(&at91_pinctrl_desc, &pdev->dev, info);
info->pctl = devm_pinctrl_register(&pdev->dev, &at91_pinctrl_desc,
info);

if (IS_ERR(info->pctl)) {
dev_err(&pdev->dev, "could not register AT91 pinctrl driver\n");
Expand All @@ -1269,15 +1270,6 @@ static int at91_pinctrl_probe(struct platform_device *pdev)
return 0;
}

static int at91_pinctrl_remove(struct platform_device *pdev)
{
struct at91_pinctrl *info = platform_get_drvdata(pdev);

pinctrl_unregister(info->pctl);

return 0;
}

static int at91_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
{
struct at91_gpio_chip *at91_gpio = gpiochip_get_data(chip);
Expand Down Expand Up @@ -1821,7 +1813,6 @@ static struct platform_driver at91_pinctrl_driver = {
.of_match_table = at91_pinctrl_of_match,
},
.probe = at91_pinctrl_probe,
.remove = at91_pinctrl_remove,
};

static struct platform_driver * const drivers[] = {
Expand Down

0 comments on commit 5c67425

Please sign in to comment.