Skip to content

Commit

Permalink
pinctrl: spear: 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: Viresh Kumar <[email protected]>
Cc: [email protected]
Cc: [email protected]
Acked-by: Viresh Kumar <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
ldewangan authored and linusw committed Apr 20, 2016
1 parent 67ec8d7 commit d39de31
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 41 deletions.
11 changes: 1 addition & 10 deletions drivers/pinctrl/spear/pinctrl-spear.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,20 +395,11 @@ int spear_pinctrl_probe(struct platform_device *pdev,
spear_pinctrl_desc.pins = machdata->pins;
spear_pinctrl_desc.npins = machdata->npins;

pmx->pctl = pinctrl_register(&spear_pinctrl_desc, &pdev->dev, pmx);
pmx->pctl = devm_pinctrl_register(&pdev->dev, &spear_pinctrl_desc, pmx);
if (IS_ERR(pmx->pctl)) {
dev_err(&pdev->dev, "Couldn't register pinctrl driver\n");
return PTR_ERR(pmx->pctl);
}

return 0;
}

int spear_pinctrl_remove(struct platform_device *pdev)
{
struct spear_pmx *pmx = platform_get_drvdata(pdev);

pinctrl_unregister(pmx->pctl);

return 0;
}
1 change: 0 additions & 1 deletion drivers/pinctrl/spear/pinctrl-spear.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ void pmx_init_gpio_pingroup_addr(struct spear_gpio_pingroup *gpio_pingroup,
unsigned count, u16 reg);
int spear_pinctrl_probe(struct platform_device *pdev,
struct spear_pinctrl_machdata *machdata);
int spear_pinctrl_remove(struct platform_device *pdev);

#define SPEAR_PIN_0_TO_101 \
PINCTRL_PIN(0, "PLGPIO0"), \
Expand Down
6 changes: 0 additions & 6 deletions drivers/pinctrl/spear/pinctrl-spear1310.c
Original file line number Diff line number Diff line change
Expand Up @@ -2704,18 +2704,12 @@ static int spear1310_pinctrl_probe(struct platform_device *pdev)
return spear_pinctrl_probe(pdev, &spear1310_machdata);
}

static int spear1310_pinctrl_remove(struct platform_device *pdev)
{
return spear_pinctrl_remove(pdev);
}

static struct platform_driver spear1310_pinctrl_driver = {
.driver = {
.name = DRIVER_NAME,
.of_match_table = spear1310_pinctrl_of_match,
},
.probe = spear1310_pinctrl_probe,
.remove = spear1310_pinctrl_remove,
};

static int __init spear1310_pinctrl_init(void)
Expand Down
6 changes: 0 additions & 6 deletions drivers/pinctrl/spear/pinctrl-spear1340.c
Original file line number Diff line number Diff line change
Expand Up @@ -2020,18 +2020,12 @@ static int spear1340_pinctrl_probe(struct platform_device *pdev)
return spear_pinctrl_probe(pdev, &spear1340_machdata);
}

static int spear1340_pinctrl_remove(struct platform_device *pdev)
{
return spear_pinctrl_remove(pdev);
}

static struct platform_driver spear1340_pinctrl_driver = {
.driver = {
.name = DRIVER_NAME,
.of_match_table = spear1340_pinctrl_of_match,
},
.probe = spear1340_pinctrl_probe,
.remove = spear1340_pinctrl_remove,
};

static int __init spear1340_pinctrl_init(void)
Expand Down
6 changes: 0 additions & 6 deletions drivers/pinctrl/spear/pinctrl-spear300.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,18 +677,12 @@ static int spear300_pinctrl_probe(struct platform_device *pdev)
return 0;
}

static int spear300_pinctrl_remove(struct platform_device *pdev)
{
return spear_pinctrl_remove(pdev);
}

static struct platform_driver spear300_pinctrl_driver = {
.driver = {
.name = DRIVER_NAME,
.of_match_table = spear300_pinctrl_of_match,
},
.probe = spear300_pinctrl_probe,
.remove = spear300_pinctrl_remove,
};

static int __init spear300_pinctrl_init(void)
Expand Down
6 changes: 0 additions & 6 deletions drivers/pinctrl/spear/pinctrl-spear310.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,18 +400,12 @@ static int spear310_pinctrl_probe(struct platform_device *pdev)
return 0;
}

static int spear310_pinctrl_remove(struct platform_device *pdev)
{
return spear_pinctrl_remove(pdev);
}

static struct platform_driver spear310_pinctrl_driver = {
.driver = {
.name = DRIVER_NAME,
.of_match_table = spear310_pinctrl_of_match,
},
.probe = spear310_pinctrl_probe,
.remove = spear310_pinctrl_remove,
};

static int __init spear310_pinctrl_init(void)
Expand Down
6 changes: 0 additions & 6 deletions drivers/pinctrl/spear/pinctrl-spear320.c
Original file line number Diff line number Diff line change
Expand Up @@ -3441,18 +3441,12 @@ static int spear320_pinctrl_probe(struct platform_device *pdev)
return 0;
}

static int spear320_pinctrl_remove(struct platform_device *pdev)
{
return spear_pinctrl_remove(pdev);
}

static struct platform_driver spear320_pinctrl_driver = {
.driver = {
.name = DRIVER_NAME,
.of_match_table = spear320_pinctrl_of_match,
},
.probe = spear320_pinctrl_probe,
.remove = spear320_pinctrl_remove,
};

static int __init spear320_pinctrl_init(void)
Expand Down

0 comments on commit d39de31

Please sign in to comment.