v2: Explicitly check for both dev->of_node and dev->parent->of_node.
This covers the MFD case, without the MFD core having to set
child MFD devices' of_node pointer to the same node as the top-
level MFD device, which causes problems such as:
http://www.spinics.net/lists/arm-kernel/msg295854.html
Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>