|
@@ -108,7 +108,13 @@ static DEFINE_IDA(hwmon_ida);
|
|
|
|
|
|
/* Thermal zone handling */
|
|
|
|
|
|
-#if IS_REACHABLE(CONFIG_THERMAL) && defined(CONFIG_THERMAL_OF)
|
|
|
+/*
|
|
|
+ * The complex conditional is necessary to avoid a cyclic dependency
|
|
|
+ * between hwmon and thermal_sys modules.
|
|
|
+ */
|
|
|
+#if IS_REACHABLE(CONFIG_THERMAL) && defined(CONFIG_THERMAL_OF) && \
|
|
|
+ (!defined(CONFIG_THERMAL_HWMON) || \
|
|
|
+ !(defined(MODULE) && IS_MODULE(CONFIG_THERMAL)))
|
|
|
static int hwmon_thermal_get_temp(void *data, int *temp)
|
|
|
{
|
|
|
struct hwmon_thermal_data *tdata = data;
|
|
@@ -153,7 +159,7 @@ static int hwmon_thermal_add_sensor(struct device *dev,
|
|
|
{
|
|
|
return 0;
|
|
|
}
|
|
|
-#endif /* IS_REACHABLE(CONFIG_THERMAL) && defined(CONFIG_THERMAL_OF) */
|
|
|
+#endif /* IS_REACHABLE(CONFIG_THERMAL) && ... */
|
|
|
|
|
|
/* sysfs attribute management */
|
|
|
|