Skip to content

Commit 311526b

Browse files
committed
thermal/drivers/db8500: Use driver dev instead of tz->device
The db8500 driver uses the thermal zone device instead of the device attached to it. In order to prevent the drivers to access the thermal zone device structure, replace the thermal zone device by the driver to show the debug message. Cc: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20230307133735.90772-5-daniel.lezcano@linaro.org
1 parent 32a7a02 commit 311526b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

drivers/thermal/db8500_thermal.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ static const unsigned long db8500_thermal_points[] = {
5353

5454
struct db8500_thermal_zone {
5555
struct thermal_zone_device *tz;
56+
struct device *dev;
5657
unsigned long interpolated_temp;
5758
unsigned int cur_index;
5859
};
@@ -114,7 +115,7 @@ static irqreturn_t prcmu_low_irq_handler(int irq, void *irq_data)
114115
idx -= 1;
115116

116117
db8500_thermal_update_config(th, idx, next_low, next_high);
117-
dev_dbg(&th->tz->device,
118+
dev_dbg(th->dev,
118119
"PRCMU set max %ld, min %ld\n", next_high, next_low);
119120

120121
thermal_zone_device_update(th->tz, THERMAL_EVENT_UNSPECIFIED);
@@ -136,7 +137,7 @@ static irqreturn_t prcmu_high_irq_handler(int irq, void *irq_data)
136137

137138
db8500_thermal_update_config(th, idx, next_low, next_high);
138139

139-
dev_dbg(&th->tz->device,
140+
dev_dbg(th->dev,
140141
"PRCMU set max %ld, min %ld\n", next_high, next_low);
141142
} else if (idx == num_points - 1)
142143
/* So we roof out 1 degree over the max point */
@@ -157,6 +158,8 @@ static int db8500_thermal_probe(struct platform_device *pdev)
157158
if (!th)
158159
return -ENOMEM;
159160

161+
th->dev = dev;
162+
160163
low_irq = platform_get_irq_byname(pdev, "IRQ_HOTMON_LOW");
161164
if (low_irq < 0)
162165
return low_irq;

0 commit comments

Comments
 (0)