From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 11 Sep 2023 14:44:33 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qfgHK-00BV87-7Z for lore@lore.pengutronix.de; Mon, 11 Sep 2023 14:44:33 +0200 Received: from bombadil.infradead.org ([2607:7c80:54:3::133]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qfgHH-0005Lm-VD for lore@pengutronix.de; Mon, 11 Sep 2023 14:44:32 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Z+yHLpxSxMz8L6iBKILKT6BVjH5hznq8CGJFsFuSKvc=; b=PDYAPzoF4ITCWoZ65vNf/IgIA4 RzjW2TD7IY5AsNFkizilKilDnYZZyaR3q7PXeNTLFtHgJ8KNX4NFUvfbxEHpCtFw+O5mUzJOFDstr X9/CQzEogPRQl9nPgRYytlt6rNn9e6rSVSHxgwXXw32ZF+/JEMLoHZBeNgh05Up85z+dSFJB6I+dX HCywcrB2cUmK0ps31Y3FSUgVb4/39FN8KULGCwmCTq/lAUqBNEOXT4rK6gS7q/H+fxJ3zPkyyeTWe DOqwld6/DhC6pIKw1l9+XZ3DzV3ZLM31OQOyMut4uyapKkVlrjvj92QI6Mrat0IEAvHk5f8+vdipw NdgXw7Ng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qfgGD-000VTx-0Q; Mon, 11 Sep 2023 12:43:25 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qfgGA-000VTY-2I for barebox@lists.infradead.org; Mon, 11 Sep 2023 12:43:24 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qfgG9-0005E9-HS; Mon, 11 Sep 2023 14:43:21 +0200 Received: from [2a0a:edc0:2:b01:1d::c0] (helo=ptx.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qfgG9-005YRg-5K; Mon, 11 Sep 2023 14:43:21 +0200 Received: from mfe by ptx.whiteo.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1qfgG8-0053NF-Sh; Mon, 11 Sep 2023 14:43:20 +0200 Date: Mon, 11 Sep 2023 14:43:20 +0200 From: Marco Felsch To: Ahmad Fatoum Cc: barebox@lists.infradead.org Message-ID: <20230911124320.ymia5ckyljzmstqs@pengutronix.de> References: <20230911122204.2698005-1-a.fatoum@pengutronix.de> <20230911123508.c54vltou62amkg7h@pengutronix.de> <7bcd35f4-81ea-323e-5277-396b7efc5c94@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7bcd35f4-81ea-323e-5277-396b7efc5c94@pengutronix.de> User-Agent: NeoMutt/20180716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230911_054322_744106_11544D1F X-CRM114-Status: GOOD ( 27.62 ) X-BeenThere: barebox@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "barebox" X-SA-Exim-Connect-IP: 2607:7c80:54:3::133 X-SA-Exim-Mail-From: barebox-bounces+lore=pengutronix.de@lists.infradead.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.whiteo.stw.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-4.9 required=4.0 tests=AWL,BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.2 Subject: Re: [PATCH master] aiodev: imx_thermal: fix breakage after device tree sync X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on metis.whiteo.stw.pengutronix.de) On 23-09-11, Ahmad Fatoum wrote: > On 11.09.23 14:35, Marco Felsch wrote: > > On 23-09-11, Ahmad Fatoum wrote: > >> fsl,tempmon-data is a deprecated property that has been replaced > >> upstream by a NVMEM cell pointing at the calibration value and so > >> made it into barebox breaking the driver. > >> > >> Switch to using the new property to fix the regression. > > > > The Linux driver code can handle the deprecated binding still, in case > > of old DTBs. Since the DTBS are builtin to barebox updating the DTB > > without the barebox binary make no sense. Anyway, do we need to take the > > deprecated binding into account as well like Linux does? > > For this reason, only the new binding is implemented. I would add this note into the commit message else someone (like me) could say that this breaks driver backward compatibility. Regards, Marco > > Regards, > > Marco > > > >> Fixes: abef60363d8e ("dts: update to v5.8-rc1") > >> Signed-off-by: Ahmad Fatoum > >> --- > >> drivers/aiodev/imx_thermal.c | 25 ++++--------------------- > >> 1 file changed, 4 insertions(+), 21 deletions(-) > >> > >> diff --git a/drivers/aiodev/imx_thermal.c b/drivers/aiodev/imx_thermal.c > >> index 3263519cb241..2693ad05e0e5 100644 > >> --- a/drivers/aiodev/imx_thermal.c > >> +++ b/drivers/aiodev/imx_thermal.c > >> @@ -22,6 +22,7 @@ > >> #include > >> #include > >> #include > >> +#include > >> #include > >> #include > >> #include > >> @@ -29,7 +30,6 @@ > >> > >> #define FACTOR0 10000000 > >> #define MEASURE_FREQ 327 > >> -#define OCOTP_ANA1_OFFSET (0xE * sizeof(uint32_t)) > >> > >> struct imx_thermal_data { > >> int c1, c2; > >> @@ -109,30 +109,13 @@ static int imx_thermal_read(struct aiochannel *chan, int *val) > >> static int imx_thermal_probe(struct device *dev) > >> { > >> uint32_t ocotp_ana1; > >> - struct device_node *node; > >> struct imx_thermal_data *imx_thermal; > >> - struct cdev *ocotp; > >> int t1, n1, t2, n2; > >> int ret; > >> > >> - node = of_parse_phandle(dev->of_node, "fsl,tempmon-data", 0); > >> - if (!node) { > >> - dev_err(dev, "No calibration data source\n"); > >> - return -ENODEV; > >> - } > >> - > >> - ocotp = cdev_by_device_node(node); > >> - if (!ocotp) { > >> - dev_err(dev, "No OCOTP character device\n"); > >> - return -ENODEV; > >> - } > >> - > >> - ret = cdev_read(ocotp, &ocotp_ana1, sizeof(ocotp_ana1), > >> - OCOTP_ANA1_OFFSET, 0); > >> - if (ret != sizeof(ocotp_ana1)) { > >> - dev_err(dev, "Failed to read calibration data\n"); > >> - return ret < 0 ? ret : -EIO; > >> - } > >> + ret = nvmem_cell_read_variable_le_u32(dev, "calib", &ocotp_ana1); > >> + if (ret) > >> + return ret; > >> > >> imx_thermal = xzalloc(sizeof(*imx_thermal)); > >> imx_thermal->base = syscon_base_lookup_by_phandle(dev->of_node, > >> -- > >> 2.39.2 > >> > >> > >> > > > > -- > Pengutronix e.K. | | > Steuerwalder Str. 21 | http://www.pengutronix.de/ | > 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | > >