Skip to content

Commit 2cffaef

Browse files
dlezcanoEduardo Valentin
authored andcommitted
thermal/drivers/hisi: Use platform_get_irq_byname
As we have the interrupt names defines, replace platform_get_irq() by platform_get_irq_byname(), so no confusion can be made when getting the interrupt with the sensor id. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
1 parent a849eec commit 2cffaef

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/thermal/hisi_thermal.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ struct hisi_thermal_data;
6363
struct hisi_thermal_sensor {
6464
struct hisi_thermal_data *data;
6565
struct thermal_zone_device *tzd;
66+
const char *irq_name;
6667
uint32_t id;
6768
uint32_t thres_temp;
6869
};
@@ -407,6 +408,7 @@ static int hi6220_thermal_probe(struct hisi_thermal_data *data)
407408
return -ENOMEM;
408409

409410
data->sensor[0].id = HI6220_CLUSTER0_SENSOR;
411+
data->sensor[0].irq_name = "tsensor_intr";
410412
data->sensor[0].data = data;
411413
data->nr_sensors = 1;
412414

@@ -423,6 +425,7 @@ static int hi3660_thermal_probe(struct hisi_thermal_data *data)
423425
return -ENOMEM;
424426

425427
data->sensor[0].id = HI3660_BIG_SENSOR;
428+
data->sensor[0].irq_name = "tsensor_a73";
426429
data->sensor[0].data = data;
427430
data->nr_sensors = 1;
428431

@@ -576,13 +579,13 @@ static int hisi_thermal_probe(struct platform_device *pdev)
576579
return ret;
577580
}
578581

579-
data->irq = platform_get_irq(pdev, 0);
582+
data->irq = platform_get_irq_byname(pdev, sensor->irq_name);
580583
if (data->irq < 0)
581584
return data->irq;
582585

583586
ret = devm_request_threaded_irq(dev, data->irq, NULL,
584587
hisi_thermal_alarm_irq_thread,
585-
IRQF_ONESHOT, "hisi_thermal",
588+
IRQF_ONESHOT, sensor->irq_name,
586589
sensor);
587590
if (ret < 0) {
588591
dev_err(dev, "failed to request alarm irq: %d\n", ret);

0 commit comments

Comments
 (0)