From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6BF7CFF8867 for ; Mon, 27 Apr 2026 20:04:24 +0000 (UTC) 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=qRIVkThlffipZ/O92mL/TKTST1+ANc+IotggZ0ZHvpo=; b=4y7H98I41B7dTHTRHX657DgHH6 rovkvPpIuqgTkUEYJM/WHjVMsaCnn3cAx81E2vM5UvKw+TtUwXhLuUNxWhrPRkajX/+UGjovDmz71 QzuWgLgJPSIPe8O37BDfKACzOroGE+txc3rafYSOki8sZkD5CyskhSYFK/qdOQgVAzr5B3OtwMSK0 KTSjDxSQIzQMbWcHw6PYacl0q87PZdDdJUPsFpQHuV4JJp/OUd9I0AHRKMh4ulz+kS8IJhbQliauL 7zn0kyUjtXbyu2p0IWnmDE6+KulPYOvpABoDEcQJJmx1HRZ0QGDth3Pp5jdjdlbB+sLkkdFA5LReQ IKKJwgLw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1wHSBm-000000005aa-1jDE; Mon, 27 Apr 2026 20:04:18 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1wHSBj-000000005aA-3rUv; Mon, 27 Apr 2026 20:04:17 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 95A5343F69; Mon, 27 Apr 2026 20:04:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30C6CC19425; Mon, 27 Apr 2026 20:04:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777320255; bh=nOBHti0wrHIQHTwQnJvsrWPDG3yEViQYOsOP4A5im4Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qmBuXREfmQAXnYSF9q5c7g4TKf65q7wBmO/Pr7wznrXG71gEoVcJ70jumCaFOOdnS Lxgz+GsnS/HXDUwI5oebFrRDr5zA6yecrBab2HnilNsk7Y4PyiTWsfsBCVgpveZwKs /RjlEPv6Ye3NMCWcdpzRVUw7s6nIuG1vM3oEg0I9RMCKVEiDsPqL84cKbW1bGNID7N IRdlVKoXA0nBmYM6UxQglYugCmb1hiDar0PvSmpb3b6sTGStl+NGofz2vVierIy692 nnhWi6H/R0GYRXjLJNg+LxxluNcXg/RxWGy6TyzuSaYLYvaGiIaMVLxlGJBaMJ74wR 7lJA5CXT6Og1Q== Date: Mon, 27 Apr 2026 21:04:10 +0100 From: Conor Dooley To: Rosen Penev Cc: devicetree@vger.kernel.org, Felix Fietkau , Lorenzo Bianconi , Ryder Lee , Shayne Chen , Sean Wang , Johannes Berg , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Thomas Bogendoerfer , "open list:MEDIATEK MT76 WIRELESS LAN DRIVER" , "open list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" , "moderated list:ARM/Mediatek SoC support" , "open list:MIPS" Subject: Re: [PATCH 3/3] wifi: mt76: remove mt76_get_of_data_from_mtd Message-ID: <20260427-sevenfold-scapegoat-9b66fb09da5c@spud> References: <20260427034427.881389-1-rosenp@gmail.com> <20260427034427.881389-4-rosenp@gmail.com> <20260427-hug-baboon-d60bb8fdfa51@spud> <20260427-safeguard-unthawed-cfb87dc55a32@spud> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="bmrn+DgUsYWxn18C" Content-Disposition: inline In-Reply-To: <20260427-safeguard-unthawed-cfb87dc55a32@spud> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260427_130416_006592_355FE275 X-CRM114-Status: GOOD ( 30.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --bmrn+DgUsYWxn18C Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 27, 2026 at 09:02:56PM +0100, Conor Dooley wrote: > On Mon, Apr 27, 2026 at 12:17:04PM -0700, Rosen Penev wrote: > > On Mon, Apr 27, 2026 at 12:09=E2=80=AFPM Conor Dooley wrote: > > > > > > On Sun, Apr 26, 2026 at 08:44:27PM -0700, Rosen Penev wrote: > > > > mt76_get_of_data_from_mtd has been replaced by > > > > mt76_get_of_data_from_nvmem in all usages. > > > > > > All users in the kernel, but what about other sources of devicetrees? > > > Those built into firmware etc? Are there none of those too? > > I'm actively removing those: https://github.com/openwrt/openwrt/pull/23= 113 > >=20 > > Anyway, irrelevant here. >=20 > Hardly, you can't break backwards compatibility with old devicetrees. > Removing known users from the kernel is one step in that process, but if > there's devicetrees in other places those cunt too! >=20 > With the moving pieces in this patchset alone it's problematic to move > this fast, since you're changing the dts user in the same series as > removing driver support (AFIACT), which means that neither netdev nor > the platform tree will work with their portion applied. Well, maybe the platform tree will work, but not the netdev tree unless I've misunderstood completely. >=20 > > > > > > Conor. > > > > > > > > > > > Remove it to prevent people from using the deprecated > > > > mediatek,mtd-eeprom binding. > > > > > > > > Signed-off-by: Rosen Penev > > > > --- > > > > drivers/net/wireless/mediatek/mt76/eeprom.c | 87 ---------------= ---- > > > > drivers/net/wireless/mediatek/mt76/mt76.h | 1 - > > > > .../wireless/mediatek/mt76/mt7915/eeprom.c | 4 - > > > > 3 files changed, 92 deletions(-) > > > > > > > > diff --git a/drivers/net/wireless/mediatek/mt76/eeprom.c b/drivers/= net/wireless/mediatek/mt76/eeprom.c > > > > index afdb73661866..092804323d81 100644 > > > > --- a/drivers/net/wireless/mediatek/mt76/eeprom.c > > > > +++ b/drivers/net/wireless/mediatek/mt76/eeprom.c > > > > @@ -35,89 +35,6 @@ static int mt76_get_of_eeprom_data(struct mt76_d= ev *dev, void *eep, int len) > > > > return 0; > > > > } > > > > > > > > -int mt76_get_of_data_from_mtd(struct mt76_dev *dev, void *eep, int= offset, int len) > > > > -{ > > > > -#ifdef CONFIG_MTD > > > > - struct device_node *np =3D dev->dev->of_node; > > > > - struct mtd_info *mtd; > > > > - const __be32 *list; > > > > - const char *part; > > > > - phandle phandle; > > > > - size_t retlen; > > > > - int size; > > > > - int ret; > > > > - > > > > - list =3D of_get_property(np, "mediatek,mtd-eeprom", &size); > > > > - if (!list) > > > > - return -ENOENT; > > > > - > > > > - phandle =3D be32_to_cpup(list++); > > > > - if (!phandle) > > > > - return -ENOENT; > > > > - > > > > - np =3D of_find_node_by_phandle(phandle); > > > > - if (!np) > > > > - return -EINVAL; > > > > - > > > > - part =3D of_get_property(np, "label", NULL); > > > > - if (!part) > > > > - part =3D np->name; > > > > - > > > > - mtd =3D get_mtd_device_nm(part); > > > > - if (IS_ERR(mtd)) { > > > > - ret =3D PTR_ERR(mtd); > > > > - goto out_put_node; > > > > - } > > > > - > > > > - if (size <=3D sizeof(*list)) { > > > > - ret =3D -EINVAL; > > > > - goto out_put_node; > > > > - } > > > > - > > > > - offset +=3D be32_to_cpup(list); > > > > - ret =3D mtd_read(mtd, offset, len, &retlen, eep); > > > > - put_mtd_device(mtd); > > > > - if (mtd_is_bitflip(ret)) > > > > - ret =3D 0; > > > > - if (ret) { > > > > - dev_err(dev->dev, "reading EEPROM from mtd %s failed:= %i\n", > > > > - part, ret); > > > > - goto out_put_node; > > > > - } > > > > - > > > > - if (retlen < len) { > > > > - ret =3D -EINVAL; > > > > - goto out_put_node; > > > > - } > > > > - > > > > - if (of_property_read_bool(dev->dev->of_node, "big-endian")) { > > > > - u8 *data =3D (u8 *)eep; > > > > - int i; > > > > - > > > > - /* convert eeprom data in Little Endian */ > > > > - for (i =3D 0; i < round_down(len, 2); i +=3D 2) > > > > - put_unaligned_le16(get_unaligned_be16(&data[i= ]), > > > > - &data[i]); > > > > - } > > > > - > > > > -#ifdef CONFIG_NL80211_TESTMODE > > > > - dev->test_mtd.name =3D devm_kstrdup(dev->dev, part, GFP_KERNE= L); > > > > - if (!dev->test_mtd.name) { > > > > - ret =3D -ENOMEM; > > > > - goto out_put_node; > > > > - } > > > > - dev->test_mtd.offset =3D offset; > > > > -#endif > > > > - > > > > -out_put_node: > > > > - of_node_put(np); > > > > - return ret; > > > > -#else > > > > - return -ENOENT; > > > > -#endif > > > > -} > > > > -EXPORT_SYMBOL_GPL(mt76_get_of_data_from_mtd); > > > > - > > > > int mt76_get_of_data_from_nvmem(struct mt76_dev *dev, void *eep, > > > > const char *cell_name, int len) > > > > { > > > > @@ -163,10 +80,6 @@ static int mt76_get_of_eeprom(struct mt76_dev *= dev, void *eep, int len) > > > > if (!ret) > > > > return 0; > > > > > > > > - ret =3D mt76_get_of_data_from_mtd(dev, eep, 0, len); > > > > - if (!ret) > > > > - return 0; > > > > - > > > > return mt76_get_of_data_from_nvmem(dev, eep, "eeprom", len); > > > > } > > > > > > > > diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/ne= t/wireless/mediatek/mt76/mt76.h > > > > index 527bef97e122..f447ecac664d 100644 > > > > --- a/drivers/net/wireless/mediatek/mt76/mt76.h > > > > +++ b/drivers/net/wireless/mediatek/mt76/mt76.h > > > > @@ -1339,7 +1339,6 @@ void mt76_seq_puts_array(struct seq_file *fil= e, const char *str, > > > > > > > > int mt76_eeprom_init(struct mt76_dev *dev, int len); > > > > int mt76_eeprom_override(struct mt76_phy *phy); > > > > -int mt76_get_of_data_from_mtd(struct mt76_dev *dev, void *eep, int= offset, int len); > > > > int mt76_get_of_data_from_nvmem(struct mt76_dev *dev, void *eep, > > > > const char *cell_name, int len); > > > > > > > > diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c b/d= rivers/net/wireless/mediatek/mt76/mt7915/eeprom.c > > > > index eb92cbf1a284..c24e1276700b 100644 > > > > --- a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c > > > > +++ b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c > > > > @@ -29,10 +29,6 @@ static int mt7915_eeprom_load_precal(struct mt79= 15_dev *dev) > > > > > > > > offs =3D is_mt7915(&dev->mt76) ? MT_EE_PRECAL : MT_EE_PRECAL_= V2; > > > > > > > > - ret =3D mt76_get_of_data_from_mtd(mdev, dev->cal, offs, size); > > > > - if (!ret) > > > > - return ret; > > > > - > > > > ret =3D mt76_get_of_data_from_nvmem(mdev, dev->cal, "precal",= size); > > > > if (!ret) > > > > return ret; > > > > -- > > > > 2.54.0 > > > > --bmrn+DgUsYWxn18C Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCae/BOQAKCRB4tDGHoIJi 0hiVAQCuQjZQ0kXNujxtGnjAFyCtQV5vV/cdvN5oxs2/TTgkRgEA0Qb6OYc/8bMe eImO8EwL5nRHSDd29R9EVtG7DSFgGQQ= =5iMX -----END PGP SIGNATURE----- --bmrn+DgUsYWxn18C--