diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 9f305ac06275d6f45adb05ff1c7567b71f0c6bde..5b1ab06d92c2dd1dc9e00cff083ed85191b4a04d 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -1913,9 +1913,6 @@ static int pinctrl_check_ops(struct pinctrl_dev *pctldev) !ops->get_group_name) return -EINVAL; - if (ops->dt_node_to_map && !ops->dt_free_map) - return -EINVAL; - return 0; } diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c index e082bddad83a0e08797e17d74991adf34404e48e..0e5c9f14a706e6f25cceeccecc0e67527e7051aa 100644 --- a/drivers/pinctrl/devicetree.c +++ b/drivers/pinctrl/devicetree.c @@ -42,7 +42,8 @@ static void dt_free_map(struct pinctrl_dev *pctldev, { if (pctldev) { 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 { /* There is no pctldev for PIN_MAP_TYPE_DUMMY_STATE */ kfree(map);