提交 c29e2f2c 编写于 作者: G Geert Uytterhoeven

pinctrl: sh-pfc: Convert to devm_gpiochip_add_data()

This allows to remove the .remove() callback, and all functions and data
it needed for its own bookkeeping.
Suggested-by: NLaxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
Acked-by: NLinus Walleij <linus.walleij@linaro.org>
上级 07d36d29
...@@ -598,15 +598,6 @@ static int sh_pfc_probe(struct platform_device *pdev) ...@@ -598,15 +598,6 @@ static int sh_pfc_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int sh_pfc_remove(struct platform_device *pdev)
{
#ifdef CONFIG_PINCTRL_SH_PFC_GPIO
sh_pfc_unregister_gpiochip(platform_get_drvdata(pdev));
#endif
return 0;
}
static const struct platform_device_id sh_pfc_id_table[] = { static const struct platform_device_id sh_pfc_id_table[] = {
#ifdef CONFIG_PINCTRL_PFC_SH7203 #ifdef CONFIG_PINCTRL_PFC_SH7203
{ "pfc-sh7203", (kernel_ulong_t)&sh7203_pinmux_info }, { "pfc-sh7203", (kernel_ulong_t)&sh7203_pinmux_info },
...@@ -650,7 +641,6 @@ static const struct platform_device_id sh_pfc_id_table[] = { ...@@ -650,7 +641,6 @@ static const struct platform_device_id sh_pfc_id_table[] = {
static struct platform_driver sh_pfc_driver = { static struct platform_driver sh_pfc_driver = {
.probe = sh_pfc_probe, .probe = sh_pfc_probe,
.remove = sh_pfc_remove,
.id_table = sh_pfc_id_table, .id_table = sh_pfc_id_table,
.driver = { .driver = {
.name = DRV_NAME, .name = DRV_NAME,
......
...@@ -20,7 +20,6 @@ struct sh_pfc_pin_range { ...@@ -20,7 +20,6 @@ struct sh_pfc_pin_range {
}; };
int sh_pfc_register_gpiochip(struct sh_pfc *pfc); int sh_pfc_register_gpiochip(struct sh_pfc *pfc);
int sh_pfc_unregister_gpiochip(struct sh_pfc *pfc);
int sh_pfc_register_pinctrl(struct sh_pfc *pfc); int sh_pfc_register_pinctrl(struct sh_pfc *pfc);
......
...@@ -318,7 +318,7 @@ sh_pfc_add_gpiochip(struct sh_pfc *pfc, int(*setup)(struct sh_pfc_chip *), ...@@ -318,7 +318,7 @@ sh_pfc_add_gpiochip(struct sh_pfc *pfc, int(*setup)(struct sh_pfc_chip *),
if (ret < 0) if (ret < 0)
return ERR_PTR(ret); return ERR_PTR(ret);
ret = gpiochip_add_data(&chip->gpio_chip, chip); ret = devm_gpiochip_add_data(pfc->dev, &chip->gpio_chip, chip);
if (unlikely(ret < 0)) if (unlikely(ret < 0))
return ERR_PTR(ret); return ERR_PTR(ret);
...@@ -399,18 +399,7 @@ int sh_pfc_register_gpiochip(struct sh_pfc *pfc) ...@@ -399,18 +399,7 @@ int sh_pfc_register_gpiochip(struct sh_pfc *pfc)
chip = sh_pfc_add_gpiochip(pfc, gpio_function_setup, NULL); chip = sh_pfc_add_gpiochip(pfc, gpio_function_setup, NULL);
if (IS_ERR(chip)) if (IS_ERR(chip))
return PTR_ERR(chip); return PTR_ERR(chip);
pfc->func = chip;
#endif /* CONFIG_SUPERH */ #endif /* CONFIG_SUPERH */
return 0; return 0;
} }
int sh_pfc_unregister_gpiochip(struct sh_pfc *pfc)
{
gpiochip_remove(&pfc->gpio->gpio_chip);
#ifdef CONFIG_SUPERH
gpiochip_remove(&pfc->func->gpio_chip);
#endif
return 0;
}
...@@ -207,9 +207,6 @@ struct sh_pfc { ...@@ -207,9 +207,6 @@ struct sh_pfc {
unsigned int nr_gpio_pins; unsigned int nr_gpio_pins;
struct sh_pfc_chip *gpio; struct sh_pfc_chip *gpio;
#ifdef CONFIG_SUPERH
struct sh_pfc_chip *func;
#endif
}; };
struct sh_pfc_soc_operations { struct sh_pfc_soc_operations {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册