c
void thermal_debug_tz_remove(struct thermal_zone_device *tz)
{
    WARN_ON(!tz);

    if (!tz)
        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);
}
