diff options
author | Subbaraman Narayanamurthy <subbaram@codeaurora.org> | 2014-02-04 13:42:28 -0800 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 21:23:52 -0700 |
commit | 30d90b4f26dd5dcae00631e589ae150fd5585330 (patch) | |
tree | a3018a276221ebdecac6afa5e038a47f3f03459d /drivers/pinctrl/devicetree.c | |
parent | 42bcb67fbc982efae2e77c1c3662c12f6fbec5e6 (diff) |
pinctrl: Fix the return value for devices without default state
Currently we're not returning a proper error value for the
devices which doesn't have default pinctrl state 0. This adds the
device to the pinctrl list and cause problems later. Fix this by
returning a proper error value when necessary.
Change-Id: Ia62a411376bddc446575f4c630ae185c6d584350
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Diffstat (limited to 'drivers/pinctrl/devicetree.c')
-rw-r--r-- | drivers/pinctrl/devicetree.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/pinctrl/devicetree.c b/drivers/pinctrl/devicetree.c index fe04e748dfe4..619afc5496ce 100644 --- a/drivers/pinctrl/devicetree.c +++ b/drivers/pinctrl/devicetree.c @@ -195,8 +195,13 @@ int pinctrl_dt_to_map(struct pinctrl *p) propname = kasprintf(GFP_KERNEL, "pinctrl-%d", state); prop = of_find_property(np, propname, &size); kfree(propname); - if (!prop) + if (!prop) { + if (!state) { + ret = -EINVAL; + goto err; + } break; + } list = prop->value; size /= sizeof(*list); |