diff options
Diffstat (limited to 'drivers/pinctrl/pinctrl-digicolor.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-digicolor.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/pinctrl/pinctrl-digicolor.c b/drivers/pinctrl/pinctrl-digicolor.c index f1343d6ca823..30ee56427f56 100644 --- a/drivers/pinctrl/pinctrl-digicolor.c +++ b/drivers/pinctrl/pinctrl-digicolor.c @@ -84,7 +84,7 @@ static struct pinctrl_ops dc_pinctrl_ops = { .get_group_name = dc_get_group_name, .get_group_pins = dc_get_group_pins, .dt_node_to_map = pinconf_generic_dt_node_to_map_pin, - .dt_free_map = pinctrl_utils_dt_free_map, + .dt_free_map = pinctrl_utils_free_map, }; static const char *const dc_functions[] = { @@ -280,7 +280,7 @@ static int dc_pinctrl_probe(struct platform_device *pdev) struct pinctrl_desc *pctl_desc; char *pin_names; int name_len = strlen("GP_xx") + 1; - int i, j, ret; + int i, j; pmap = devm_kzalloc(&pdev->dev, sizeof(*pmap), GFP_KERNEL); if (!pmap) @@ -326,26 +326,19 @@ static int dc_pinctrl_probe(struct platform_device *pdev) pmap->dev = &pdev->dev; - pmap->pctl = pinctrl_register(pctl_desc, &pdev->dev, pmap); + pmap->pctl = devm_pinctrl_register(&pdev->dev, pctl_desc, pmap); if (IS_ERR(pmap->pctl)) { dev_err(&pdev->dev, "pinctrl driver registration failed\n"); return PTR_ERR(pmap->pctl); } - ret = dc_gpiochip_add(pmap, pdev->dev.of_node); - if (ret < 0) { - pinctrl_unregister(pmap->pctl); - return ret; - } - - return 0; + return dc_gpiochip_add(pmap, pdev->dev.of_node); } static int dc_pinctrl_remove(struct platform_device *pdev) { struct dc_pinmap *pmap = platform_get_drvdata(pdev); - pinctrl_unregister(pmap->pctl); gpiochip_remove(&pmap->chip); return 0; |