Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jiri Slaby (SUSE) and committed by
Daniel Lezcano
7ee2c3c0 992e2ed0

+6 -10
+1 -2
drivers/thermal/qcom/lmh.c
··· 209 209 } 210 210 211 211 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); 214 213 if (!lmh_data->domain) { 215 214 dev_err(dev, "Error adding irq_domain\n"); 216 215 return -EINVAL;
+5 -8
drivers/thermal/tegra/soctherm.c
··· 1206 1206 /** 1207 1207 * soctherm_oc_int_init() - Initial enabling of the over 1208 1208 * current interrupts 1209 - * @np: The devicetree node for soctherm 1209 + * @fwnode: The devicetree node for soctherm 1210 1210 * @num_irqs: The number of new interrupt requests 1211 1211 * 1212 1212 * Sets the over current interrupt request chip data ··· 1215 1215 * -ENOMEM (out of memory), or irq_base if the function failed to 1216 1216 * allocate the irqs 1217 1217 */ 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) 1219 1219 { 1220 1220 if (!num_irqs) { 1221 1221 pr_info("%s(): OC interrupts are not enabled\n", __func__); ··· 1234 1234 soc_irq_cdata.irq_chip.irq_set_type = soctherm_oc_irq_set_type; 1235 1235 soc_irq_cdata.irq_chip.irq_set_wake = NULL; 1236 1236 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); 1241 1239 if (!soc_irq_cdata.domain) { 1242 1240 pr_err("%s: Failed to create IRQ domain\n", __func__); 1243 1241 return -ENOMEM; ··· 1966 1968 static int soctherm_interrupts_init(struct platform_device *pdev, 1967 1969 struct tegra_soctherm *tegra) 1968 1970 { 1969 - struct device_node *np = pdev->dev.of_node; 1970 1971 int ret; 1971 1972 1972 - ret = soctherm_oc_int_init(np, TEGRA_SOC_OC_IRQ_MAX); 1973 + ret = soctherm_oc_int_init(dev_fwnode(&pdev->dev), TEGRA_SOC_OC_IRQ_MAX); 1973 1974 if (ret < 0) { 1974 1975 dev_err(&pdev->dev, "soctherm_oc_int_init failed\n"); 1975 1976 return ret;