c
void thermal_debug_tz_remove(struct thermal_zone_device *tz)
{
    if (IS_ERR_OR_NULL(tz)) {
        printk(KERN_ERR "thermal_debug_tz_remove: tz is NULL or error\n");
        return;
    }

    struct thermal_debugfs *thermal_dbg = tz->debugfs;

    if (!thermal_dbg)
        return;

    mutex_lock(&thermal_dbg->lock);

    tz->debugfs = NULL;

    mutex_unlock(&thermal_dbg->lock);

    thermal_debugfs_remove_id(thermal_dbg);
}
