From 30d90b4f26dd5dcae00631e589ae150fd5585330 Mon Sep 17 00:00:00 2001 From: Subbaraman Narayanamurthy Date: Tue, 4 Feb 2014 13:42:28 -0800 Subject: 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 --- drivers/pinctrl/devicetree.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3