]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: rt2x00: use generic nvmem_cell_get
authorRosen Penev <rosenp@gmail.com>
Mon, 23 Feb 2026 21:40:04 +0000 (13:40 -0800)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 2 Mar 2026 08:31:15 +0000 (09:31 +0100)
The library doesn't necessarily depend on OF. This codepath is used by
both soc (OF only) and pci (no such requirement). After this, the only
of specific function is of_get_mac_address, which is needed for nvmem.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Link: https://patch.msgid.link/20260223214004.19960-1-rosenp@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/ralink/rt2x00/rt2800lib.c

index ca18a4c7e14ad229f9d9cb09a87ceda296b3312e..2e2e382b624757ffcd826f37faebc36f38d04f11 100644 (file)
@@ -10965,13 +10965,13 @@ EXPORT_SYMBOL_GPL(rt2800_read_eeprom_efuse);
 
 int rt2800_read_eeprom_nvmem(struct rt2x00_dev *rt2x00dev)
 {
-       struct device_node *np = rt2x00dev->dev->of_node;
+       struct device *dev = rt2x00dev->dev;
        unsigned int len = rt2x00dev->ops->eeprom_size;
        struct nvmem_cell *cell;
        const void *data;
        size_t retlen;
 
-       cell = of_nvmem_cell_get(np, "eeprom");
+       cell = nvmem_cell_get(dev, "eeprom");
        if (IS_ERR(cell))
                return PTR_ERR(cell);