thermal/of: Replace device node match with device node search
authorDaniel Lezcano <daniel.lezcano@linexp.org>
Fri, 22 Jul 2022 19:59:59 +0000 (21:59 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Thu, 28 Jul 2022 15:29:53 +0000 (17:29 +0200)
commita3193edcbdf9a8ae73b6e1f2da96e920582c1849
treea1d5bed4ce87d584ec46ff2a6a70f128be9d8b65
parent3f95ac324535eafafd436d35bf58f0319dd4a70b
thermal/of: Replace device node match with device node search

The thermal_of code builds a trip array associated with the node
pointer in order to compare the trip point phandle with the list.

The thermal trip is a thermal zone property and should be moved
there. If some sensors have hardcoded trip points, they should use the
exported structure instead of redefining again and again their own
structure and data to describe exactly the same things.

In order to move this to the thermal.h header and allow more cleanup,
we need to remove the node pointer from the structure.

Instead of building storing the device node, we search directly in the
device tree the corresponding node. That results in a simplification
of the code and allows to move the structure to thermal.h

Cc: Alexandre Bailon <abailon@baylibre.com>
Cc: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linexp.org>
Link: https://lore.kernel.org/r/20220722200007.1839356-3-daniel.lezcano@linexp.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/thermal/thermal_of.c