Skip to content

Commit

Permalink
pinctrl: uniphier: 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: Masahiro Yamada <[email protected]>
Acked-by: Masahiro Yamada <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
ldewangan authored and linusw committed Apr 20, 2016
1 parent e46e3ef commit 1ac471e
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 19 deletions.
12 changes: 1 addition & 11 deletions drivers/pinctrl/uniphier/pinctrl-uniphier-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ int uniphier_pinctrl_probe(struct platform_device *pdev,
desc->pmxops = &uniphier_pmxops;
desc->confops = &uniphier_confops;

priv->pctldev = pinctrl_register(desc, dev, priv);
priv->pctldev = devm_pinctrl_register(dev, desc, priv);
if (IS_ERR(priv->pctldev)) {
dev_err(dev, "failed to register UniPhier pinctrl driver\n");
return PTR_ERR(priv->pctldev);
Expand All @@ -676,13 +676,3 @@ int uniphier_pinctrl_probe(struct platform_device *pdev,
return 0;
}
EXPORT_SYMBOL_GPL(uniphier_pinctrl_probe);

int uniphier_pinctrl_remove(struct platform_device *pdev)
{
struct uniphier_pinctrl_priv *priv = platform_get_drvdata(pdev);

pinctrl_unregister(priv->pctldev);

return 0;
}
EXPORT_SYMBOL_GPL(uniphier_pinctrl_remove);
1 change: 0 additions & 1 deletion drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,6 @@ MODULE_DEVICE_TABLE(of, ph1_ld4_pinctrl_match);

static struct platform_driver ph1_ld4_pinctrl_driver = {
.probe = ph1_ld4_pinctrl_probe,
.remove = uniphier_pinctrl_remove,
.driver = {
.name = DRIVER_NAME,
.of_match_table = ph1_ld4_pinctrl_match,
Expand Down
1 change: 0 additions & 1 deletion drivers/pinctrl/uniphier/pinctrl-uniphier-ld6b.c
Original file line number Diff line number Diff line change
Expand Up @@ -1266,7 +1266,6 @@ MODULE_DEVICE_TABLE(of, ph1_ld6b_pinctrl_match);

static struct platform_driver ph1_ld6b_pinctrl_driver = {
.probe = ph1_ld6b_pinctrl_probe,
.remove = uniphier_pinctrl_remove,
.driver = {
.name = DRIVER_NAME,
.of_match_table = ph1_ld6b_pinctrl_match,
Expand Down
1 change: 0 additions & 1 deletion drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,6 @@ MODULE_DEVICE_TABLE(of, ph1_pro4_pinctrl_match);

static struct platform_driver ph1_pro4_pinctrl_driver = {
.probe = ph1_pro4_pinctrl_probe,
.remove = uniphier_pinctrl_remove,
.driver = {
.name = DRIVER_NAME,
.of_match_table = ph1_pro4_pinctrl_match,
Expand Down
1 change: 0 additions & 1 deletion drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,6 @@ MODULE_DEVICE_TABLE(of, ph1_pro5_pinctrl_match);

static struct platform_driver ph1_pro5_pinctrl_driver = {
.probe = ph1_pro5_pinctrl_probe,
.remove = uniphier_pinctrl_remove,
.driver = {
.name = DRIVER_NAME,
.of_match_table = ph1_pro5_pinctrl_match,
Expand Down
1 change: 0 additions & 1 deletion drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,6 @@ MODULE_DEVICE_TABLE(of, proxstream2_pinctrl_match);

static struct platform_driver proxstream2_pinctrl_driver = {
.probe = proxstream2_pinctrl_probe,
.remove = uniphier_pinctrl_remove,
.driver = {
.name = DRIVER_NAME,
.of_match_table = proxstream2_pinctrl_match,
Expand Down
1 change: 0 additions & 1 deletion drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,6 @@ MODULE_DEVICE_TABLE(of, ph1_sld8_pinctrl_match);

static struct platform_driver ph1_sld8_pinctrl_driver = {
.probe = ph1_sld8_pinctrl_probe,
.remove = uniphier_pinctrl_remove,
.driver = {
.name = DRIVER_NAME,
.of_match_table = ph1_sld8_pinctrl_match,
Expand Down
2 changes: 0 additions & 2 deletions drivers/pinctrl/uniphier/pinctrl-uniphier.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,4 @@ int uniphier_pinctrl_probe(struct platform_device *pdev,
struct pinctrl_desc *desc,
struct uniphier_pinctrl_socdata *socdata);

int uniphier_pinctrl_remove(struct platform_device *pdev);

#endif /* __PINCTRL_UNIPHIER_H__ */

0 comments on commit 1ac471e

Please sign in to comment.