diff options
Diffstat (limited to 'drivers/thermal/hisi_thermal.c')
-rw-r--r-- | drivers/thermal/hisi_thermal.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c index 07f421f0e783..3a07b72a2db6 100644 --- a/drivers/thermal/hisi_thermal.c +++ b/drivers/thermal/hisi_thermal.c @@ -585,10 +585,6 @@ static int hisi_thermal_probe(struct platform_device *pdev) return PTR_ERR(data->regs); } - data->irq = platform_get_irq(pdev, 0); - if (data->irq < 0) - return data->irq; - ret = data->ops->probe(data); if (ret) return ret; @@ -596,6 +592,19 @@ static int hisi_thermal_probe(struct platform_device *pdev) for (i = 0; i < data->nr_sensors; i++) { struct hisi_thermal_sensor *sensor = &data->sensor[i]; + data->irq = platform_get_irq(pdev, i); + if (data->irq < 0) + return data->irq; + + ret = devm_request_threaded_irq(dev, data->irq, NULL, + hisi_thermal_alarm_irq_thread, + IRQF_ONESHOT, "hisi_thermal", + data); + if (ret < 0) { + dev_err(dev, "failed to request alarm irq: %d\n", ret); + return ret; + } + ret = hisi_thermal_register_sensor(pdev, sensor); if (ret) { dev_err(dev, "failed to register thermal sensor: %d\n", @@ -612,17 +621,6 @@ static int hisi_thermal_probe(struct platform_device *pdev) hisi_thermal_toggle_sensor(sensor, true); } - if (data->irq) { - ret = devm_request_threaded_irq(dev, data->irq, NULL, - hisi_thermal_alarm_irq_thread, - IRQF_ONESHOT, "hisi_thermal", - data); - if (ret < 0) { - dev_err(dev, "failed to request alarm irq: %d\n", ret); - return ret; - } - } - return 0; } |