Skip to content

Commit

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

Signed-off-by: Laxman Dewangan <[email protected]>
Cc: Stephen Warren <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Alexandre Courbot <[email protected]>
Acked-by: Stephen Warren <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
ldewangan authored and linusw committed Apr 20, 2016
1 parent 45078ea commit f1daa8a
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 18 deletions.
12 changes: 1 addition & 11 deletions drivers/pinctrl/tegra/pinctrl-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ int tegra_pinctrl_probe(struct platform_device *pdev,
return PTR_ERR(pmx->regs[i]);
}

pmx->pctl = pinctrl_register(&tegra_pinctrl_desc, &pdev->dev, pmx);
pmx->pctl = devm_pinctrl_register(&pdev->dev, &tegra_pinctrl_desc, pmx);
if (IS_ERR(pmx->pctl)) {
dev_err(&pdev->dev, "Couldn't register pinctrl driver\n");
return PTR_ERR(pmx->pctl);
Expand All @@ -753,13 +753,3 @@ int tegra_pinctrl_probe(struct platform_device *pdev,
return 0;
}
EXPORT_SYMBOL_GPL(tegra_pinctrl_probe);

int tegra_pinctrl_remove(struct platform_device *pdev)
{
struct tegra_pmx *pmx = platform_get_drvdata(pdev);

pinctrl_unregister(pmx->pctl);

return 0;
}
EXPORT_SYMBOL_GPL(tegra_pinctrl_remove);
2 changes: 0 additions & 2 deletions drivers/pinctrl/tegra/pinctrl-tegra.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,4 @@ struct tegra_pinctrl_soc_data {

int tegra_pinctrl_probe(struct platform_device *pdev,
const struct tegra_pinctrl_soc_data *soc_data);
int tegra_pinctrl_remove(struct platform_device *pdev);

#endif
1 change: 0 additions & 1 deletion drivers/pinctrl/tegra/pinctrl-tegra114.c
Original file line number Diff line number Diff line change
Expand Up @@ -1865,7 +1865,6 @@ static struct platform_driver tegra114_pinctrl_driver = {
.of_match_table = tegra114_pinctrl_of_match,
},
.probe = tegra114_pinctrl_probe,
.remove = tegra_pinctrl_remove,
};
module_platform_driver(tegra114_pinctrl_driver);

Expand Down
1 change: 0 additions & 1 deletion drivers/pinctrl/tegra/pinctrl-tegra124.c
Original file line number Diff line number Diff line change
Expand Up @@ -2077,7 +2077,6 @@ static struct platform_driver tegra124_pinctrl_driver = {
.of_match_table = tegra124_pinctrl_of_match,
},
.probe = tegra124_pinctrl_probe,
.remove = tegra_pinctrl_remove,
};
module_platform_driver(tegra124_pinctrl_driver);

Expand Down
1 change: 0 additions & 1 deletion drivers/pinctrl/tegra/pinctrl-tegra20.c
Original file line number Diff line number Diff line change
Expand Up @@ -2245,7 +2245,6 @@ static struct platform_driver tegra20_pinctrl_driver = {
.of_match_table = tegra20_pinctrl_of_match,
},
.probe = tegra20_pinctrl_probe,
.remove = tegra_pinctrl_remove,
};
module_platform_driver(tegra20_pinctrl_driver);

Expand Down
1 change: 0 additions & 1 deletion drivers/pinctrl/tegra/pinctrl-tegra210.c
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,6 @@ static struct platform_driver tegra210_pinctrl_driver = {
.of_match_table = tegra210_pinctrl_of_match,
},
.probe = tegra210_pinctrl_probe,
.remove = tegra_pinctrl_remove,
};
module_platform_driver(tegra210_pinctrl_driver);

Expand Down
1 change: 0 additions & 1 deletion drivers/pinctrl/tegra/pinctrl-tegra30.c
Original file line number Diff line number Diff line change
Expand Up @@ -2500,7 +2500,6 @@ static struct platform_driver tegra30_pinctrl_driver = {
.of_match_table = tegra30_pinctrl_of_match,
},
.probe = tegra30_pinctrl_probe,
.remove = tegra_pinctrl_remove,
};
module_platform_driver(tegra30_pinctrl_driver);

Expand Down

0 comments on commit f1daa8a

Please sign in to comment.