summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/devicetree.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2016-12-30 10:37:31 -0800
committerLinus Walleij <linus.walleij@linaro.org>2017-01-09 19:41:07 +0100
commit92c2b671848e7816455ba5374e98913d920f3257 (patch)
treea28248ac8382d86bf500416d99232c2ee095e816 /drivers/pinctrl/devicetree.c
parentd83bb5a46dedc39a1226272bec4eb47867ba25d4 (diff)
downloadlinux-92c2b671848e7816455ba5374e98913d920f3257.tar.gz
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: Tony Lindgren <tony@atomide.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/devicetree.c')
-rw-r--r--drivers/pinctrl/devicetree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c
index e082bddad83a..0e5c9f14a706 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);