[PATCH v4 0/5] Introduce of_get_child_by_name
Srinivas KANDAGATLA
srinivas.kandagatla at st.com
Tue Sep 18 17:10:14 EST 2012
From: Srinivas Kandagatla <srinivas.kandagatla at st.com>
This patch series introduces of_get_child_by_name function to get a
child node by its name in a given parent node and also removes code
duplication in some of the existing driver code by using of_get_child_by_name.
Normally if a driver want to get a child node it would iterate all the nodes
of parent and compare its name and then get it.
This use case is becoming common as device trees are used more, so moving this
functionality to a libary function makes sense.
Having of_get_child_by_name libary function would avoid code duplication,
errors, proper reference counting and is more convenient.
Changes from v3:
- Removed extra of_get_node from of_get_child_by_name.
- reordered of_put_node in hvc_opal.c
Changes from v2:
- Fixed typo errors.
- Removed bogus patches which used "type" instead of "name"
- Fixed reference counting in follow-up patches.
Changes from v1:
-rename of_get_child to of_get_child_by_name.
-remove read lock in of_get_child_by_name.
-make use of of_get_child_by_name in the existing kernel code.
Srinivas Kandagatla (5):
dt: introduce of_get_child_by_name to get child node by name
dt/powerpc/powernv: Use of_get_child_by_name to get a named child
dt/powerpc/sysdev: Use of_get_child_by_name to get a named child
dt/s3c64xx/spi: Use of_get_child_by_name to get a named child
dt/tty/opal: Use of_get_child_by_name to get a named child
arch/powerpc/platforms/powernv/opal.c | 6 +++---
arch/powerpc/sysdev/qe_lib/qe.c | 5 +----
drivers/of/base.c | 23 +++++++++++++++++++++++
drivers/spi/spi-s3c64xx.c | 7 ++++---
drivers/tty/hvc/hvc_opal.c | 9 ++-------
include/linux/of.h | 2 ++
6 files changed, 35 insertions(+), 17 deletions(-)
More information about the Linuxppc-dev
mailing list