static int amlogic_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
 {
        unsigned int tval;
-       struct amlogic_thermal *pdata = tz->devdata;
+       struct amlogic_thermal *pdata = thermal_zone_device_priv(tz);
 
        if (!pdata)
                return -EINVAL;
 
 static int armada_get_temp_legacy(struct thermal_zone_device *thermal,
                                  int *temp)
 {
-       struct armada_thermal_priv *priv = thermal->devdata;
+       struct armada_thermal_priv *priv = thermal_zone_device_priv(thermal);
        int ret;
 
        /* Valid check */
 
 static int armada_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct armada_thermal_sensor *sensor = tz->devdata;
+       struct armada_thermal_sensor *sensor = thermal_zone_device_priv(tz);
        struct armada_thermal_priv *priv = sensor->priv;
        int ret;
 
 
 
 static int bcm2711_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct bcm2711_thermal_priv *priv = tz->devdata;
+       struct bcm2711_thermal_priv *priv = thermal_zone_device_priv(tz);
        int slope = thermal_zone_get_slope(tz);
        int offset = thermal_zone_get_offset(tz);
        u32 val;
 
 
 static int bcm2835_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct bcm2835_thermal_data *data = tz->devdata;
+       struct bcm2835_thermal_data *data = thermal_zone_device_priv(tz);
        u32 val = readl(data->regs + BCM2835_TS_TSENSSTAT);
 
        if (!(val & BCM2835_TS_TSENSSTAT_VALID))
 
 
 static int brcmstb_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct brcmstb_thermal_priv *priv = tz->devdata;
+       struct brcmstb_thermal_priv *priv = thermal_zone_device_priv(tz);
        u32 val;
        long t;
 
 
 static int brcmstb_set_trips(struct thermal_zone_device *tz, int low, int high)
 {
-       struct brcmstb_thermal_priv *priv = tz->devdata;
+       struct brcmstb_thermal_priv *priv = thermal_zone_device_priv(tz);
 
        dev_dbg(priv->dev, "set trips %d <--> %d\n", low, high);
 
 
 
 static int ns_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       void __iomem *pvtmon = tz->devdata;
+       void __iomem *pvtmon = thermal_zone_device_priv(tz);
        int offset = thermal_zone_get_offset(tz);
        int slope = thermal_zone_get_slope(tz);
        u32 val;
 
 
 static int sr_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct sr_tmon *tmon = tz->devdata;
+       struct sr_tmon *tmon = thermal_zone_device_priv(tz);
        struct sr_thermal *sr_thermal = tmon->priv;
 
        *temp = readl(sr_thermal->regs + SR_TMON_TEMP_BASE(tmon->tmon_id));
 
 static int da9062_thermal_get_temp(struct thermal_zone_device *z,
                                   int *temp)
 {
-       struct da9062_thermal *thermal = z->devdata;
+       struct da9062_thermal *thermal = thermal_zone_device_priv(z);
 
        mutex_lock(&thermal->lock);
        *temp = thermal->temperature;
 
 /* Callback to get current temperature */
 static int db8500_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct db8500_thermal_zone *th = tz->devdata;
+       struct db8500_thermal_zone *th = thermal_zone_device_priv(tz);
 
        /*
         * TODO: There is no PRCMU interface to get temperature data currently,
 
                          int *temp)
 {
        unsigned long reg;
-       struct dove_thermal_priv *priv = thermal->devdata;
+       struct dove_thermal_priv *priv = thermal_zone_device_priv(thermal);
 
        /* Valid check */
        reg = readl_relaxed(priv->control + PMU_TEMP_DIOD_CTRL1_REG);
 
 
 static int hisi_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct hisi_thermal_sensor *sensor = tz->devdata;
+       struct hisi_thermal_sensor *sensor = thermal_zone_device_priv(tz);
        struct hisi_thermal_data *data = sensor->data;
 
        *temp = data->ops->get_temp(sensor);
 
 
 static int tmu_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct tmu_sensor *sensor = tz->devdata;
+       struct tmu_sensor *sensor = thermal_zone_device_priv(tz);
        struct imx8mm_tmu *tmu = sensor->priv;
 
        return tmu->socdata->get_temp(sensor, temp);
 
 {
        struct imx_sc_msg_misc_get_temp msg;
        struct imx_sc_rpc_msg *hdr = &msg.hdr;
-       struct imx_sc_sensor *sensor = tz->devdata;
+       struct imx_sc_sensor *sensor = thermal_zone_device_priv(tz);
        int ret;
 
        msg.data.req.resource_id = sensor->resource_id;
 
 
 static int imx_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct imx_thermal_data *data = tz->devdata;
+       struct imx_thermal_data *data = thermal_zone_device_priv(tz);
        const struct thermal_soc_data *soc_data = data->socdata;
        struct regmap *map = data->tempmon;
        unsigned int n_meas;
 static int imx_change_mode(struct thermal_zone_device *tz,
                           enum thermal_device_mode mode)
 {
-       struct imx_thermal_data *data = tz->devdata;
+       struct imx_thermal_data *data = thermal_zone_device_priv(tz);
 
        if (mode == THERMAL_DEVICE_ENABLED) {
                pm_runtime_get(data->dev);
 static int imx_set_trip_temp(struct thermal_zone_device *tz, int trip,
                             int temp)
 {
-       struct imx_thermal_data *data = tz->devdata;
+       struct imx_thermal_data *data = thermal_zone_device_priv(tz);
        int ret;
 
        ret = pm_runtime_resume_and_get(data->dev);
 
 static int int3400_thermal_change_mode(struct thermal_zone_device *thermal,
                                       enum thermal_device_mode mode)
 {
-       struct int3400_thermal_priv *priv = thermal->devdata;
+       struct int3400_thermal_priv *priv = thermal_zone_device_priv(thermal);
        int result = 0;
 
        if (!priv)
 
 static int int340x_thermal_get_zone_temp(struct thermal_zone_device *zone,
                                         int *temp)
 {
-       struct int34x_thermal_zone *d = zone->devdata;
+       struct int34x_thermal_zone *d = thermal_zone_device_priv(zone);
        unsigned long long tmp;
        acpi_status status;
 
 static int int340x_thermal_set_trip_temp(struct thermal_zone_device *zone,
                                         int trip, int temp)
 {
-       struct int34x_thermal_zone *d = zone->devdata;
+       struct int34x_thermal_zone *d = thermal_zone_device_priv(zone);
        char name[] = {'P', 'A', 'T', '0' + trip, '\0'};
        acpi_status status;
 
 
 
 static int sys_get_curr_temp(struct thermal_zone_device *tzd, int *temp)
 {
-       struct proc_thermal_pci *pci_info = tzd->devdata;
+       struct proc_thermal_pci *pci_info = thermal_zone_device_priv(tzd);
        u32 _temp;
 
        proc_thermal_mmio_read(pci_info, PROC_THERMAL_MMIO_PKG_TEMP, &_temp);
 
 static int sys_set_trip_temp(struct thermal_zone_device *tzd, int trip, int temp)
 {
-       struct proc_thermal_pci *pci_info = tzd->devdata;
+       struct proc_thermal_pci *pci_info = thermal_zone_device_priv(tzd);
        int tjmax, _temp;
 
        if (temp <= 0) {
 
 
 static int pch_thermal_get_temp(struct thermal_zone_device *tzd, int *temp)
 {
-       struct pch_thermal_device *ptd = tzd->devdata;
+       struct pch_thermal_device *ptd = thermal_zone_device_priv(tzd);
 
        *temp = GET_WPT_TEMP(WPT_TEMP_TSR & readw(ptd->hw_base + WPT_TEMP));
        return 0;
 
 static int soc_dts_enable(struct thermal_zone_device *tzd)
 {
        u32 out;
-       struct soc_sensor_entry *aux_entry = tzd->devdata;
+       struct soc_sensor_entry *aux_entry = thermal_zone_device_priv(tzd);
        int ret;
 
        ret = iosf_mbi_read(QRK_MBI_UNIT_RMU, MBI_REG_READ,
 static int soc_dts_disable(struct thermal_zone_device *tzd)
 {
        u32 out;
-       struct soc_sensor_entry *aux_entry = tzd->devdata;
+       struct soc_sensor_entry *aux_entry = thermal_zone_device_priv(tzd);
        int ret;
 
        ret = iosf_mbi_read(QRK_MBI_UNIT_RMU, MBI_REG_READ,
 static inline int sys_set_trip_temp(struct thermal_zone_device *tzd, int trip,
                                int temp)
 {
-       return update_trip_temp(tzd->devdata, trip, temp);
+       return update_trip_temp(thermal_zone_device_priv(tzd), trip, temp);
 }
 
 static int sys_get_curr_temp(struct thermal_zone_device *tzd,
 
        struct intel_soc_dts_sensor_entry *dts;
        struct intel_soc_dts_sensors *sensors;
 
-       dts = tzd->devdata;
+       dts = thermal_zone_device_priv(tzd);
        sensors = dts->sensors;
        mutex_lock(&sensors->dts_update_lock);
        status = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ,
 static int sys_set_trip_temp(struct thermal_zone_device *tzd, int trip,
                             int temp)
 {
-       struct intel_soc_dts_sensor_entry *dts = tzd->devdata;
+       struct intel_soc_dts_sensor_entry *dts = thermal_zone_device_priv(tzd);
        struct intel_soc_dts_sensors *sensors = dts->sensors;
        int status;
 
                return -EINVAL;
 
        mutex_lock(&sensors->dts_update_lock);
-       status = update_trip_temp(tzd->devdata, trip, temp,
+       status = update_trip_temp(dts, trip, temp,
                                  dts->trip_types[trip]);
        mutex_unlock(&sensors->dts_update_lock);
 
 static int sys_get_trip_type(struct thermal_zone_device *tzd,
                             int trip, enum thermal_trip_type *type)
 {
-       struct intel_soc_dts_sensor_entry *dts;
-
-       dts = tzd->devdata;
+       struct intel_soc_dts_sensor_entry *dts = thermal_zone_device_priv(tzd);
 
        *type = dts->trip_types[trip];
 
 {
        int status;
        u32 out;
-       struct intel_soc_dts_sensor_entry *dts;
+       struct intel_soc_dts_sensor_entry *dts = thermal_zone_device_priv(tzd);
        struct intel_soc_dts_sensors *sensors;
        unsigned long raw;
 
-       dts = tzd->devdata;
        sensors = dts->sensors;
        status = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ,
                               SOC_DTS_OFFSET_TEMP, &out);
 
 
 static int sys_get_curr_temp(struct thermal_zone_device *tzd, int *temp)
 {
-       struct zone_device *zonedev = tzd->devdata;
+       struct zone_device *zonedev = thermal_zone_device_priv(tzd);
        int val;
 
        val = intel_tcc_get_temp(zonedev->cpu, true);
 static int
 sys_set_trip_temp(struct thermal_zone_device *tzd, int trip, int temp)
 {
-       struct zone_device *zonedev = tzd->devdata;
+       struct zone_device *zonedev = thermal_zone_device_priv(tzd);
        u32 l, h, mask, shift, intr;
        int tj_max, ret;
 
 
 
 static int k3_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct k3_thermal_data *data = tz->devdata;
+       struct k3_thermal_data *data = thermal_zone_device_priv(tz);
        int ret = 0;
 
        ret = k3_bgp_read_temp(data, temp);
 
 /* Get temperature callback function for thermal zone */
 static int k3_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       return k3_bgp_read_temp(tz->devdata, temp);
+       return k3_bgp_read_temp(thermal_zone_device_priv(tz), temp);
 }
 
 static const struct thermal_zone_device_ops k3_of_thermal_ops = {
 
                          int *temp)
 {
        unsigned long reg;
-       struct kirkwood_thermal_priv *priv = thermal->devdata;
+       struct kirkwood_thermal_priv *priv = thermal_zone_device_priv(thermal);
 
        reg = readl_relaxed(priv->sensor);
 
 
 
 static int max77620_thermal_read_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct max77620_therm_info *mtherm = tz->devdata;
+       struct max77620_therm_info *mtherm = thermal_zone_device_priv(tz);
        unsigned int val;
        int ret;
 
 
 
 static int mtk_read_temp(struct thermal_zone_device *tz, int *temperature)
 {
-       struct mtk_thermal *mt = tz->devdata;
+       struct mtk_thermal *mt = thermal_zone_device_priv(tz);
        int i;
        int tempmax = INT_MIN;
 
 
 
 static int lvts_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct lvts_sensor *lvts_sensor = tz->devdata;
+       struct lvts_sensor *lvts_sensor = thermal_zone_device_priv(tz);
        void __iomem *msr = lvts_sensor->msr;
        u32 value;
 
 
 static int lvts_set_trips(struct thermal_zone_device *tz, int low, int high)
 {
-       struct lvts_sensor *lvts_sensor = tz->devdata;
+       struct lvts_sensor *lvts_sensor = thermal_zone_device_priv(tz);
        void __iomem *base = lvts_sensor->base;
        u32 raw_low = lvts_temp_to_raw(low);
        u32 raw_high = lvts_temp_to_raw(high);
 
 
 static int adc_tm5_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct adc_tm5_channel *channel = tz->devdata;
+       struct adc_tm5_channel *channel = thermal_zone_device_priv(tz);
        int ret;
 
        if (!channel || !channel->iio)
 
 static int adc_tm5_set_trips(struct thermal_zone_device *tz, int low, int high)
 {
-       struct adc_tm5_channel *channel = tz->devdata;
+       struct adc_tm5_channel *channel = thermal_zone_device_priv(tz);
        struct adc_tm5_chip *chip;
        int ret;
 
 
 
 static int qpnp_tm_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct qpnp_tm_chip *chip = tz->devdata;
+       struct qpnp_tm_chip *chip = thermal_zone_device_priv(tz);
        int ret, mili_celsius;
 
        if (!temp)
 
 static int qpnp_tm_set_trip_temp(struct thermal_zone_device *tz, int trip_id, int temp)
 {
-       struct qpnp_tm_chip *chip = tz->devdata;
+       struct qpnp_tm_chip *chip = thermal_zone_device_priv(tz);
        struct thermal_trip trip;
        int ret;
 
 
 
 static int tsens_set_trips(struct thermal_zone_device *tz, int low, int high)
 {
-       struct tsens_sensor *s = tz->devdata;
+       struct tsens_sensor *s = thermal_zone_device_priv(tz);
        struct tsens_priv *priv = s->priv;
        struct device *dev = priv->dev;
        struct tsens_irq_data d;
 
 static int tsens_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct tsens_sensor *s = tz->devdata;
+       struct tsens_sensor *s = thermal_zone_device_priv(tz);
        struct tsens_priv *priv = s->priv;
 
        return priv->ops->get_temp(s, temp);
 
 
 static int tmu_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct qoriq_sensor *qsensor = tz->devdata;
+       struct qoriq_sensor *qsensor = thermal_zone_device_priv(tz);
        struct qoriq_tmu_data *qdata = qoriq_sensor_to_data(qsensor);
        u32 val;
        /*
 
 
 static int rcar_gen3_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct rcar_gen3_thermal_tsc *tsc = tz->devdata;
+       struct rcar_gen3_thermal_tsc *tsc = thermal_zone_device_priv(tz);
        int mcelsius, val;
        int reg;
 
 
 static int rcar_gen3_thermal_set_trips(struct thermal_zone_device *tz, int low, int high)
 {
-       struct rcar_gen3_thermal_tsc *tsc = tz->devdata;
+       struct rcar_gen3_thermal_tsc *tsc = thermal_zone_device_priv(tz);
        u32 irqmsk = 0;
 
        if (low != -INT_MAX) {
 
        list_for_each_entry(pos, &common->head, list)
 
 #define MCELSIUS(temp)                 ((temp) * 1000)
-#define rcar_zone_to_priv(zone)                ((zone)->devdata)
 #define rcar_priv_to_dev(priv)         ((priv)->common->dev)
 #define rcar_has_irq_support(priv)     ((priv)->common->base)
 #define rcar_id_to_shift(priv)         ((priv)->id * 8)
 
 static int rcar_thermal_get_temp(struct thermal_zone_device *zone, int *temp)
 {
-       struct rcar_thermal_priv *priv = rcar_zone_to_priv(zone);
+       struct rcar_thermal_priv *priv = thermal_zone_device_priv(zone);
 
        return rcar_thermal_get_current_temp(priv, temp);
 }
 
 
 static int rockchip_thermal_set_trips(struct thermal_zone_device *tz, int low, int high)
 {
-       struct rockchip_thermal_sensor *sensor = tz->devdata;
+       struct rockchip_thermal_sensor *sensor = thermal_zone_device_priv(tz);
        struct rockchip_thermal_data *thermal = sensor->thermal;
        const struct rockchip_tsadc_chip *tsadc = thermal->chip;
 
 
 static int rockchip_thermal_get_temp(struct thermal_zone_device *tz, int *out_temp)
 {
-       struct rockchip_thermal_sensor *sensor = tz->devdata;
+       struct rockchip_thermal_sensor *sensor = thermal_zone_device_priv(tz);
        struct rockchip_thermal_data *thermal = sensor->thermal;
        const struct rockchip_tsadc_chip *tsadc = sensor->thermal->chip;
        int retval;
 
 
 static int rzg2l_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct rzg2l_thermal_priv *priv = tz->devdata;
+       struct rzg2l_thermal_priv *priv = thermal_zone_device_priv(tz);
        u32 result = 0, dsensor, ts_code_ave;
        int val, i;
 
 
 
 static int exynos_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct exynos_tmu_data *data = tz->devdata;
+       struct exynos_tmu_data *data = thermal_zone_device_priv(tz);
        int value, ret = 0;
 
        if (!data || !data->tmu_read)
 
 static int exynos_tmu_set_emulation(struct thermal_zone_device *tz, int temp)
 {
-       struct exynos_tmu_data *data = tz->devdata;
+       struct exynos_tmu_data *data = thermal_zone_device_priv(tz);
        int ret = -EINVAL;
 
        if (data->soc == SOC_ARCH_EXYNOS4210)
 
 static inline int thermal_get_temp(struct thermal_zone_device *thermal,
                                int *temp)
 {
-       struct spear_thermal_dev *stdev = thermal->devdata;
+       struct spear_thermal_dev *stdev = thermal_zone_device_priv(thermal);
 
        /*
         * Data are ready to be read after 628 usec from POWERDOWN signal
 static int __maybe_unused spear_thermal_suspend(struct device *dev)
 {
        struct thermal_zone_device *spear_thermal = dev_get_drvdata(dev);
-       struct spear_thermal_dev *stdev = spear_thermal->devdata;
+       struct spear_thermal_dev *stdev = thermal_zone_device_priv(spear_thermal);
        unsigned int actual_mask = 0;
 
        /* Disable SPEAr Thermal Sensor */
 static int __maybe_unused spear_thermal_resume(struct device *dev)
 {
        struct thermal_zone_device *spear_thermal = dev_get_drvdata(dev);
-       struct spear_thermal_dev *stdev = spear_thermal->devdata;
+       struct spear_thermal_dev *stdev = thermal_zone_device_priv(spear_thermal);
        unsigned int actual_mask = 0;
        int ret = 0;
 
 {
        unsigned int actual_mask = 0;
        struct thermal_zone_device *spear_thermal = platform_get_drvdata(pdev);
-       struct spear_thermal_dev *stdev = spear_thermal->devdata;
+       struct spear_thermal_dev *stdev = thermal_zone_device_priv(spear_thermal);
 
        thermal_zone_device_unregister(spear_thermal);
 
 
 
 static int sprd_thm_read_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct sprd_thermal_sensor *sen = tz->devdata;
+       struct sprd_thermal_sensor *sen = thermal_zone_device_priv(tz);
        u32 data;
 
        data = readl(sen->data->base + SPRD_THM_TEMP(sen->id)) &
 
 /* Callback to get temperature from HW*/
 static int st_thermal_get_temp(struct thermal_zone_device *th, int *temperature)
 {
-       struct st_thermal_sensor *sensor = th->devdata;
+       struct st_thermal_sensor *sensor = thermal_zone_device_priv(th);
        struct device *dev = sensor->dev;
        unsigned int temp;
        unsigned int overflow;
 
 
 static int stm_thermal_set_trips(struct thermal_zone_device *tz, int low, int high)
 {
-       struct stm_thermal_sensor *sensor = tz->devdata;
+       struct stm_thermal_sensor *sensor = thermal_zone_device_priv(tz);
        u32 itr1, th;
        int ret;
 
 /* Callback to get temperature from HW */
 static int stm_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct stm_thermal_sensor *sensor = tz->devdata;
+       struct stm_thermal_sensor *sensor = thermal_zone_device_priv(tz);
        u32 periods;
        int freqM, ret;
 
 
 
 static int sun8i_ths_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct tsensor *s = tz->devdata;
+       struct tsensor *s = thermal_zone_device_priv(tz);
        struct ths_device *tmdev = s->tmdev;
        int val = 0;
 
 
 
 static int tegra_thermctl_get_temp(struct thermal_zone_device *tz, int *out_temp)
 {
-       struct tegra_thermctl_zone *zone = tz->devdata;
+       struct tegra_thermctl_zone *zone = thermal_zone_device_priv(tz);
        u32 val;
 
        val = readl(zone->reg);
 
 static int tegra_thermctl_set_trip_temp(struct thermal_zone_device *tz, int trip_id, int temp)
 {
-       struct tegra_thermctl_zone *zone = tz->devdata;
+       struct tegra_thermctl_zone *zone = thermal_zone_device_priv(tz);
        struct tegra_soctherm *ts = zone->ts;
        struct thermal_trip trip;
        const struct tegra_tsensor_group *sg = zone->sg;
 
 static int tegra_thermctl_set_trips(struct thermal_zone_device *tz, int lo, int hi)
 {
-       struct tegra_thermctl_zone *zone = tz->devdata;
+       struct tegra_thermctl_zone *zone = thermal_zone_device_priv(tz);
        u32 r;
 
        thermal_irq_disable(zone);
 
 
 static int tegra_bpmp_thermal_get_temp(struct thermal_zone_device *tz, int *out_temp)
 {
-       return __tegra_bpmp_thermal_get_temp(tz->devdata, out_temp);
+       struct tegra_bpmp_thermal_zone *zone = thermal_zone_device_priv(tz);
+
+       return __tegra_bpmp_thermal_get_temp(zone, out_temp);
 }
 
 static int tegra_bpmp_thermal_set_trips(struct thermal_zone_device *tz, int low, int high)
 {
-       struct tegra_bpmp_thermal_zone *zone = tz->devdata;
+       struct tegra_bpmp_thermal_zone *zone = thermal_zone_device_priv(tz);
        struct mrq_thermal_host_to_bpmp_request req;
        struct tegra_bpmp_message msg;
        int err;
 
 
 static int tegra_tsensor_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       const struct tegra_tsensor_channel *tsc = tz->devdata;
+       const struct tegra_tsensor_channel *tsc = thermal_zone_device_priv(tz);
        const struct tegra_tsensor *ts = tsc->ts;
        int err, c1, c2, c3, c4, counter;
        u32 val;
 
 static int tegra_tsensor_set_trips(struct thermal_zone_device *tz, int low, int high)
 {
-       const struct tegra_tsensor_channel *tsc = tz->devdata;
+       const struct tegra_tsensor_channel *tsc = thermal_zone_device_priv(tz);
        const struct tegra_tsensor *ts = tsc->ts;
        u32 val;
 
 
 
 static int gadc_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
 {
-       struct gadc_thermal_info *gti = tz->devdata;
+       struct gadc_thermal_info *gti = thermal_zone_device_priv(tz);
        int val;
        int ret;
 
 
 static int thermal_mmio_get_temperature(struct thermal_zone_device *tz, int *temp)
 {
        int t;
-       struct thermal_mmio *sensor = tz->devdata;
+       struct thermal_mmio *sensor = thermal_zone_device_priv(tz);
 
        t = sensor->read_mmio(sensor->mmio_base) & sensor->mask;
        t *= sensor->factor;
 
 static inline int __ti_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
 {
        struct thermal_zone_device *pcb_tz = NULL;
-       struct ti_thermal_data *data = tz->devdata;
+       struct ti_thermal_data *data = thermal_zone_device_priv(tz);
        struct ti_bandgap *bgp;
        const struct ti_temp_sensor *s;
        int ret, tmp, slope, constant;
 
 static int __ti_thermal_get_trend(struct thermal_zone_device *tz, int trip, enum thermal_trend *trend)
 {
-       struct ti_thermal_data *data = tz->devdata;
+       struct ti_thermal_data *data = thermal_zone_device_priv(tz);
        struct ti_bandgap *bgp;
        int id, tr, ret = 0;
 
 
 
 static int uniphier_tm_get_temp(struct thermal_zone_device *tz, int *out_temp)
 {
-       struct uniphier_tm_dev *tdev = tz->devdata;
+       struct uniphier_tm_dev *tdev = thermal_zone_device_priv(tz);
        struct regmap *map = tdev->regmap;
        int ret;
        u32 temp;