diff options
author | Mark Brown <broonie@linaro.org> | 2014-04-04 21:39:02 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-04-04 21:39:02 +0100 |
commit | 270cfc4788befe0e1a16bf1b3a7b80d9f4127c57 (patch) | |
tree | 7bde98363eba71811a4e5c10ac04eef1d8d75db2 /drivers/pinctrl/pinctrl-utils.c | |
parent | baeae2041e14d5b7a272b9941b88fb56d716f643 (diff) |
pinctrl: utils : add support to pass config type in generic util APIs
Add support to pass the config type like GROUP or PIN when using
the utils or generic pin configuration APIs. This will make the
APIs more generic.
Added additional inline APIs such that it can be use directly as
callback for the pinctrl_ops.
Changes from V1:
- Remove separate implementation for pins and group for
pinctrl_utils_dt_free_map and improve this function
to support both i.e. PINS and GROUPs.
[For LSK restore the original API and add a _new() variant of the
functions for external consumption instead, maintaining the existing API
-- broonie]
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
(cherry-picked from commit 3287c24088abded9f111ca797fdd36f86912d199)
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-utils.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-utils.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/pinctrl/pinctrl-utils.c b/drivers/pinctrl/pinctrl-utils.c index b7ac646c43ba..48277e025f84 100644 --- a/drivers/pinctrl/pinctrl-utils.c +++ b/drivers/pinctrl/pinctrl-utils.c @@ -126,10 +126,16 @@ void pinctrl_utils_dt_free_map(struct pinctrl_dev *pctldev, { int i; - for (i = 0; i < num_maps; i++) - if (map[i].type == PIN_MAP_TYPE_CONFIGS_GROUP) + for (i = 0; i < num_maps; i++) { + switch (map[i].type) { + case PIN_MAP_TYPE_CONFIGS_GROUP: + case PIN_MAP_TYPE_CONFIGS_PIN: kfree(map[i].data.configs.configs); - + break; + default: + break; + } + } kfree(map); } EXPORT_SYMBOL_GPL(pinctrl_utils_dt_free_map); |