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 <mohant@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2169058
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Tested-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Nagaraj Annaiah <nannaiah@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Mohan Thadikamalla
2019-08-06 13:36:06 +05:30
committed by Revanth Kumar Uppala
parent c3ed68143b
commit e1fbd14f38

View File

@@ -1111,8 +1111,16 @@ static struct thermal_cooling_device_ops ether_cdev_ops = {
*/ */
static int ether_therm_init(struct ether_priv_data *pdata) static int ether_therm_init(struct ether_priv_data *pdata)
{ {
pdata->tcd = thermal_cooling_device_register("tegra-eqos", pdata, struct device_node *np = NULL;
&ether_cdev_ops);
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,
&ether_cdev_ops);
if (!pdata->tcd) { if (!pdata->tcd) {
return -ENODEV; return -ENODEV;
} else if (IS_ERR(pdata->tcd)) { } else if (IS_ERR(pdata->tcd)) {