mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 11:03:43 +02:00
pinctrl: cirrus: madera-core: Use devm_pinctrl_register_mappings()
Use devm_pinctrl_register_mappings(), so the mappings are automatically
unregistered by the core. If pinctrl_enable() failed during the probe,
pinctrl_mappings were not freed. Now it is done by the core.
Fixes: 218d72a77b ("pinctrl: madera: Add driver for Cirrus Logic Madera codecs")
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/20250609-pinctrl-madera-devm-pinctrl-register-mappings-v1-1-ba2c2822cf6c@bootlin.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
86491c2b99
commit
90256033c1
|
|
@ -1061,8 +1061,9 @@ static int madera_pin_probe(struct platform_device *pdev)
|
|||
|
||||
/* if the configuration is provided through pdata, apply it */
|
||||
if (pdata->gpio_configs) {
|
||||
ret = pinctrl_register_mappings(pdata->gpio_configs,
|
||||
pdata->n_gpio_configs);
|
||||
ret = devm_pinctrl_register_mappings(priv->dev,
|
||||
pdata->gpio_configs,
|
||||
pdata->n_gpio_configs);
|
||||
if (ret)
|
||||
return dev_err_probe(priv->dev, ret,
|
||||
"Failed to register pdata mappings\n");
|
||||
|
|
@ -1081,17 +1082,8 @@ static int madera_pin_probe(struct platform_device *pdev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void madera_pin_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct madera_pin_private *priv = platform_get_drvdata(pdev);
|
||||
|
||||
if (priv->madera->pdata.gpio_configs)
|
||||
pinctrl_unregister_mappings(priv->madera->pdata.gpio_configs);
|
||||
}
|
||||
|
||||
static struct platform_driver madera_pin_driver = {
|
||||
.probe = madera_pin_probe,
|
||||
.remove = madera_pin_remove,
|
||||
.driver = {
|
||||
.name = "madera-pinctrl",
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user