diff --git a/drivers/soc/rockchip/rockchip_system_monitor.c b/drivers/soc/rockchip/rockchip_system_monitor.c index dd20883979b5..fdce0001bb15 100644 --- a/drivers/soc/rockchip/rockchip_system_monitor.c +++ b/drivers/soc/rockchip/rockchip_system_monitor.c @@ -1186,6 +1186,11 @@ rockchip_system_monitor_wide_temp_init(struct monitor_dev_info *info) info->is_low_temp = true; } + if (!system_monitor->tz) { + dev_err(info->dev, "thermal zone is NULL\n"); + return; + } + ret = thermal_zone_get_temp(system_monitor->tz, &temp); if (ret || temp == THERMAL_TEMP_INVALID) { dev_err(info->dev, @@ -1373,6 +1378,11 @@ rockchip_system_monitor_register(struct device *dev, if (!devp) return ERR_PTR(-EINVAL); + if (!devp->check_rate_volt) { + dev_warn(dev, "using default check_rate_volt\n"); + devp->check_rate_volt = rockchip_monitor_check_rate_volt; + } + info = kzalloc(sizeof(*info), GFP_KERNEL); if (!info) return ERR_PTR(-ENOMEM);