pinctrl: handle zero found dt pinconfig properties better

A patch from »pinctrl: fix some issues with new pinconfig dt parsing« in state Mainline for linux-kernel

From: Heiko Stuebner <heiko@...> Date: Fri, 14 Jun 2013 16:12:55 +0200

Commit-Message

This adds a shortcut when no valid pinconf properties are found in the parsed dt node, to set the values immediately and return. Suggested-by: Laurent Pinchart <laurent.pinchart@...> Signed-off-by: Heiko Stuebner <heiko@...>

Patch-Comment

drivers/pinctrl/pinconf-generic.c | 7 +++++++ 1 file changed, 7 insertions(+)

Statistics

  • 7 lines added
  • 0 lines removed

Changes

---------------------- drivers/pinctrl/pinconf-generic.c -----------------------
index dcf0371..ea9da17 100644
@@ -208,6 +208,13 @@ int pinconf_generic_parse_dt_config(struct device_node *np,
ncfg++;
}
+ /* no configs found at all */
+ if (ncfg == 0) {
+ *configs = NULL;
+ *nconfigs = 0;
+ return 0;
+ }
+
/*
* Now limit the number of configs to the real number of
* found properties.
 
 

Recent Patches

About Us

Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer.

Read More...