Files
twx-linux/include/linux
Johan Hovold f3e3c50c36 of: add helper to lookup compatible child node
[ Upstream commit 36156f9241 ]

Add of_get_compatible_child() helper that can be used to lookup
compatible child nodes.

Several drivers currently use of_find_compatible_node() to lookup child
nodes while failing to notice that the of_find_ functions search the
entire tree depth-first (from a given start node) and therefore can
match unrelated nodes. The fact that these functions also drop a
reference to the node they start searching from (e.g. the parent node)
is typically also overlooked, something which can lead to use-after-free
bugs.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-12-01 09:46:35 +01:00
..
…
2018-11-21 09:27:42 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-03-09 15:34:52 -08:00
…
…
…
…
…
2018-04-08 11:51:57 +02:00
…
…
…
2018-04-24 09:32:12 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-06-14 13:16:23 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2017-05-14 13:32:59 +02:00
…
…
2017-07-15 11:57:44 +02:00
…
…
…
…
2018-01-17 09:35:30 +01:00
…
…
…
…
…
…
…
2018-06-16 09:54:26 +02:00
…
…
2017-08-06 19:19:42 -07:00
…
…
…
…
…
…
…
…
…
…
2018-04-24 09:32:07 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-04-20 15:42:02 +09:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-10-28 03:01:30 -04:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2015-11-23 09:44:58 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-03-03 15:07:28 -08:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-12-08 07:15:24 +01:00
…
…
…
2017-08-24 17:02:36 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2016-09-30 10:18:37 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2018-11-21 09:27:36 +01:00
…
2016-04-12 09:08:35 -07:00
…
…
…
…
…
…
…
…
…
…
…
2018-11-27 16:08:02 +01:00
…
…
…
…
2015-11-23 09:44:58 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2015-12-13 14:30:59 -08:00
…
…
2015-11-13 20:34:33 -05:00
…
…
…
…
…
…
…
…