Skip to content

Commit 7ee2c3c

Browse files
Jiri Slaby (SUSE)dlezcano
authored andcommitted
thermal: Use dev_fwnode()
irq_domain_create_simple() takes fwnode as the first argument. It can be extracted from the struct device using dev_fwnode() helper instead of using of_node with of_fwnode_handle(). So use the dev_fwnode() helper. Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org> Cc: Amit Kucheria <amitk@kernel.org> Cc: Thara Gopinath <thara.gopinath@gmail.com> Cc: Rafael J. Wysocki <rafael@kernel.org> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Zhang Rui <rui.zhang@intel.com> Cc: Lukasz Luba <lukasz.luba@arm.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Jonathan Hunter <jonathanh@nvidia.com> Cc: linux-arm-msm@vger.kernel.org Cc: linux-tegra@vger.kernel.org Link: https://lore.kernel.org/r/20250611104348.192092-20-jirislaby@kernel.org Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
1 parent 992e2ed commit 7ee2c3c

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

drivers/thermal/qcom/lmh.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,7 @@ static int lmh_probe(struct platform_device *pdev)
209209
}
210210

211211
lmh_data->irq = platform_get_irq(pdev, 0);
212-
lmh_data->domain = irq_domain_create_linear(of_fwnode_handle(np), 1, &lmh_irq_ops,
213-
lmh_data);
212+
lmh_data->domain = irq_domain_create_linear(dev_fwnode(dev), 1, &lmh_irq_ops, lmh_data);
214213
if (!lmh_data->domain) {
215214
dev_err(dev, "Error adding irq_domain\n");
216215
return -EINVAL;

drivers/thermal/tegra/soctherm.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ static const struct irq_domain_ops soctherm_oc_domain_ops = {
12061206
/**
12071207
* soctherm_oc_int_init() - Initial enabling of the over
12081208
* current interrupts
1209-
* @np: The devicetree node for soctherm
1209+
* @fwnode: The devicetree node for soctherm
12101210
* @num_irqs: The number of new interrupt requests
12111211
*
12121212
* Sets the over current interrupt request chip data
@@ -1215,7 +1215,7 @@ static const struct irq_domain_ops soctherm_oc_domain_ops = {
12151215
* -ENOMEM (out of memory), or irq_base if the function failed to
12161216
* allocate the irqs
12171217
*/
1218-
static int soctherm_oc_int_init(struct device_node *np, int num_irqs)
1218+
static int soctherm_oc_int_init(struct fwnode_handle *fwnode, int num_irqs)
12191219
{
12201220
if (!num_irqs) {
12211221
pr_info("%s(): OC interrupts are not enabled\n", __func__);
@@ -1234,10 +1234,8 @@ static int soctherm_oc_int_init(struct device_node *np, int num_irqs)
12341234
soc_irq_cdata.irq_chip.irq_set_type = soctherm_oc_irq_set_type;
12351235
soc_irq_cdata.irq_chip.irq_set_wake = NULL;
12361236

1237-
soc_irq_cdata.domain = irq_domain_create_linear(of_fwnode_handle(np), num_irqs,
1238-
&soctherm_oc_domain_ops,
1239-
&soc_irq_cdata);
1240-
1237+
soc_irq_cdata.domain = irq_domain_create_linear(fwnode, num_irqs, &soctherm_oc_domain_ops,
1238+
&soc_irq_cdata);
12411239
if (!soc_irq_cdata.domain) {
12421240
pr_err("%s: Failed to create IRQ domain\n", __func__);
12431241
return -ENOMEM;
@@ -1968,10 +1966,9 @@ static void tegra_soctherm_throttle(struct device *dev)
19681966
static int soctherm_interrupts_init(struct platform_device *pdev,
19691967
struct tegra_soctherm *tegra)
19701968
{
1971-
struct device_node *np = pdev->dev.of_node;
19721969
int ret;
19731970

1974-
ret = soctherm_oc_int_init(np, TEGRA_SOC_OC_IRQ_MAX);
1971+
ret = soctherm_oc_int_init(dev_fwnode(&pdev->dev), TEGRA_SOC_OC_IRQ_MAX);
19751972
if (ret < 0) {
19761973
dev_err(&pdev->dev, "soctherm_oc_int_init failed\n");
19771974
return ret;

0 commit comments

Comments
 (0)