Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9cdb0eec authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy Committed by Matt Wagantall
Browse files

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: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent eff4af9e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -201,8 +201,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);