From e1fbd14f380cf03f861c33ad1e2a5a772771512c Mon Sep 17 00:00:00 2001 From: Mohan Thadikamalla Date: Tue, 6 Aug 2019 13:36:06 +0530 Subject: [PATCH] nvethernet: Register thermal device with DT Update thermal cooling device register with device tree node reference for proper thermal zone bind. Bug 200508665 Bug 1679250 Change-Id: I113be183fa7d655f74c1ffb40db8d6482b9f1dc9 Signed-off-by: Mohan Thadikamalla Reviewed-on: https://git-master.nvidia.com/r/2169058 Reviewed-by: Srinivas Ramachandran Tested-by: Srinivas Ramachandran Reviewed-by: Nagaraj Annaiah Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Bitan Biswas Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/net/ethernet/nvidia/nvethernet/ether_linux.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c index 9641eb91..90f22c0e 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c +++ b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c @@ -1111,8 +1111,16 @@ static struct thermal_cooling_device_ops ether_cdev_ops = { */ static int ether_therm_init(struct ether_priv_data *pdata) { - pdata->tcd = thermal_cooling_device_register("tegra-eqos", pdata, - ðer_cdev_ops); + struct device_node *np = NULL; + + np = of_find_node_by_name(NULL, "eqos-cool-dev"); + if (!np) { + dev_err(pdata->dev, "failed to get eqos-cool-dev\n"); + return -ENODEV; + } + pdata->tcd = thermal_of_cooling_device_register(np, + "tegra-eqos", pdata, + ðer_cdev_ops); if (!pdata->tcd) { return -ENODEV; } else if (IS_ERR(pdata->tcd)) {