@@ -592,8 +592,8 @@ struct thermal_zone_device *thermal_of_zone_register(struct device_node *sensor,
struct thermal_zone_params *tzp;
struct thermal_zone_device_ops *of_ops;
struct device_node *np;
- int delay, pdelay;
- int ntrips, mask;
+ int delay = 0, pdelay = 0;
+ int ntrips = 0, mask = 0;
int ret;
of_ops = kmemdup(ops, sizeof(*ops), GFP_KERNEL);
@@ -610,7 +610,9 @@ struct thermal_zone_device *thermal_of_zone_register(struct device_node *sensor,
trips = thermal_of_trips_init(np, &ntrips);
if (IS_ERR(trips)) {
pr_err("Failed to find trip points for %pOFn id=%d\n", sensor, id);
- return ERR_CAST(trips);
+ pr_err("Trip points are compulsory for thermal zones, please add them to the DTS\n");
+ trips = NULL;
+ goto out_register;
}
ret = thermal_of_monitor_init(np, &delay, &pdelay);
@@ -636,6 +638,7 @@ struct thermal_zone_device *thermal_of_zone_register(struct device_node *sensor,
mask = GENMASK_ULL((ntrips) - 1, 0);
+out_register:
tz = thermal_zone_device_register_with_trips(np->name, trips, ntrips,
mask, data, of_ops, tzp,
pdelay, delay);