Commit 92c2b671 authored by Tony Lindgren's avatar Tony Lindgren Committed by Linus Walleij

pinctrl: core: Make dt_free_map optional

If the pin controller driver is using devm_kzalloc, there may not be
anything to do for dt_free_map. Let's make it optional to avoid
unncessary boilerplate code.
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent d83bb5a4
...@@ -1913,9 +1913,6 @@ static int pinctrl_check_ops(struct pinctrl_dev *pctldev) ...@@ -1913,9 +1913,6 @@ static int pinctrl_check_ops(struct pinctrl_dev *pctldev)
!ops->get_group_name) !ops->get_group_name)
return -EINVAL; return -EINVAL;
if (ops->dt_node_to_map && !ops->dt_free_map)
return -EINVAL;
return 0; return 0;
} }
......
...@@ -42,7 +42,8 @@ static void dt_free_map(struct pinctrl_dev *pctldev, ...@@ -42,7 +42,8 @@ static void dt_free_map(struct pinctrl_dev *pctldev,
{ {
if (pctldev) { if (pctldev) {
const struct pinctrl_ops *ops = pctldev->desc->pctlops; const struct pinctrl_ops *ops = pctldev->desc->pctlops;
ops->dt_free_map(pctldev, map, num_maps); if (ops->dt_free_map)
ops->dt_free_map(pctldev, map, num_maps);
} else { } else {
/* There is no pctldev for PIN_MAP_TYPE_DUMMY_STATE */ /* There is no pctldev for PIN_MAP_TYPE_DUMMY_STATE */
kfree(map); kfree(map);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment