Jon Hunter ed3fdebc33 thermal: max77851: Fix build for pre-Linux v6.1 kernels
The max77851 driver is failing to build for Linux kernels v5.16 to v6.0
and the following error is seen ...

 drivers/thermal/max77851_thermal.c:173:30: error: implicit declaration
 of function 'devm_thermal_of_zone_register'; did you mean
 'devm_thermal_zone_of_sensor_register'?
 [-Werror=implicit-function-declaration]
   thermal->tz_device = devm_thermal_of_zone_register(&pdev->dev, 0,
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The function devm_thermal_of_zone_register() was introduced in Linux
kernel v6.1 and not v5.16.

Instead of relying on kernel version to determine if this function is
present using the conftest.sh script which checks the kernel that is
being compiled to see if this function is present or not. This is also
beneficial for working with 3rd party Linux kernels that may have
back-ported upstream changes into their kernel and so the kernel version
checks do not work either.

Bug 200749982

Change-Id: I8d5e70d2d39497d7f513c82cd3a45312b2bc016a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2980925
2023-09-23 14:34:00 -07:00
2022-12-07 23:57:14 -08:00
Description
No description provided
34 MiB