staging: mt7621-pinctrl: refactor rt2880_pinctrl_dt_node_to_map function
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Thu, 28 Jun 2018 19:03:06 +0000 (21:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Jul 2018 15:33:43 +0000 (17:33 +0200)
commite12a1a6e087b9803befc6e9ab47734716c3e20e2
treee05aad32742423e6068326712fcea843bb3e4101
parentd7461eab5a04e8426dc5ddcbf7911903d22b69f4
staging: mt7621-pinctrl: refactor rt2880_pinctrl_dt_node_to_map function

Using 'function' and 'group' bindings in the device tree give the
posibility of refactor 'rt2880_pinctrl_dt_node_to_map' and simplify
it a lot. Make use of 'for_each_node_with_property' function to count
number of groups for the node and iterate over the groups using
'of_property_for_each_string' calling 'pinctrl_utils_add_map_mux'
function which is the same of the custom function in this driver code
'rt2880_pinctrl_dt_subnode_to_map' which is not needed anymore.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c