In order to get the thermal zone id but without directly accessing the
thermal zone device structure, add an accessor.
Use the accessor in the hwmon_scmi and acpi_thermal.
No functional change intented.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
                goto acpi_bus_detach;
 
        dev_info(&tz->device->dev, "registered as thermal_zone%d\n",
-                tz->thermal_zone->id);
+                thermal_zone_device_id(tz->thermal_zone));
 
        return 0;
 
 
                        sensor->name);
        } else {
                dev_dbg(dev, "Sensor '%s' attached to thermal zone ID:%d\n",
-                       sensor->name, tzd->id);
+                       sensor->name, thermal_zone_device_id(tzd));
        }
 
        return 0;
 
 }
 EXPORT_SYMBOL_GPL(thermal_zone_device_type);
 
+int thermal_zone_device_id(struct thermal_zone_device *tzd)
+{
+       return tzd->id;
+}
+EXPORT_SYMBOL_GPL(thermal_zone_device_id);
+
 /**
  * thermal_zone_device_unregister - removes the registered thermal zone device
  * @tz: the thermal zone device to remove
 
 
 void *thermal_zone_device_priv(struct thermal_zone_device *tzd);
 const char *thermal_zone_device_type(struct thermal_zone_device *tzd);
+int thermal_zone_device_id(struct thermal_zone_device *tzd);
 
 int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int,
                                     struct thermal_cooling_device *,
        return NULL;
 }
 
+static inline int thermal_zone_device_id(struct thermal_zone_device *tzd)
+{
+       return -ENODEV;
+}
+
 static inline int thermal_zone_device_enable(struct thermal_zone_device *tz)
 { return -ENODEV; }