From patchwork Tue May 19 10:05:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 245988 List-Id: U-Boot discussion From: peng.fan at nxp.com (Peng Fan) Date: Tue, 19 May 2020 10:05:21 +0000 Subject: [PATCH 2/2] thermal: imx_scu_thermal: fix getting DT alert property value In-Reply-To: <20200519113542.52b30bdf@crub> References: <20200516203420.24409-1-agust@denx.de> <20200516203420.24409-2-agust@denx.de> <20200517131828.2c3686e5@crub> <20200517165317.662d7ae2@crub> <20200519113542.52b30bdf@crub> Message-ID: > Subject: Re: [PATCH 2/2] thermal: imx_scu_thermal: fix getting DT alert > property value > > Hi Peng, > > On Sun, 17 May 2020 16:53:17 +0200 > Anatolij Gustschin agust at denx.de wrote: > ... > > Will try to bisect later. > > bisecting leads to: > # first bad commit: [3ee6ea443eb466399ab325a58b377326ac5c57b5] > cpu: imx_cpu: Print the CPU temperature for iMX8QM A72 Would this help? Thanks, Peng. > > -- > Anatolij diff --git a/drivers/cpu/imx8_cpu.c b/drivers/cpu/imx8_cpu.c index 95c14c98d8..6c949ccbd4 100644 --- a/drivers/cpu/imx8_cpu.c +++ b/drivers/cpu/imx8_cpu.c @@ -68,10 +68,13 @@ static int cpu_imx_get_temp(struct cpu_imx_platdata *plat) struct udevice *thermal_dev; int cpu_tmp, ret; - if (!strcmp(plat->name, "A72")) - ret = uclass_get_device(UCLASS_THERMAL, 1, &thermal_dev); - else - ret = uclass_get_device(UCLASS_THERMAL, 0, &thermal_dev); + if (!strcmp(plat->name, "A72")) { + ret = uclass_get_device_by_name(UCLASS_THERMAL, "cpu-thermal1", + &thermal_dev); + } else { + ret = uclass_get_device_by_name(UCLASS_THERMAL, "cpu-thermal0", + &thermal_dev); + } if (!ret) { ret = thermal_get_temp(thermal_dev, &cpu_tmp);