kernel: backport NVMEM changes queued for v6.8
[openwrt/staging/dangole.git] / target / linux / generic / pending-6.1 / 804-nvmem-core-support-mac-base-fixed-layout-cells.patch
index 95f29b1865dd5f0d3734198bbbda6b12e2a97778..9bb94a28b54b6ac07d79dfc65188290709bc5a24 100644 (file)
@@ -15,9 +15,9 @@ string.
  menuconfig NVMEM
        bool "NVMEM Support"
 +      select GENERIC_NET_UTILS
+       imply NVMEM_LAYOUTS
        help
          Support for NVMEM(Non Volatile Memory) devices like EEPROM, EFUSES...
 --- a/drivers/nvmem/core.c
 +++ b/drivers/nvmem/core.c
 @@ -7,9 +7,12 @@
@@ -33,7 +33,7 @@ string.
  #include <linux/init.h>
  #include <linux/kref.h>
  #include <linux/module.h>
-@@ -696,6 +699,62 @@ static int nvmem_validate_keepouts(struc
+@@ -780,6 +783,62 @@ static int nvmem_validate_keepouts(struc
        return 0;
  }
  
@@ -95,10 +95,10 @@ string.
 +
  static int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np)
  {
-       struct nvmem_layout *layout = nvmem->layout;
-@@ -731,6 +790,25 @@ static int nvmem_add_cells_from_dt(struc
-               if (layout && layout->fixup_cell_info)
-                       layout->fixup_cell_info(nvmem, layout, &info);
+       struct device *dev = &nvmem->dev;
+@@ -814,6 +873,25 @@ static int nvmem_add_cells_from_dt(struc
+               if (nvmem->fixup_dt_cell_info)
+                       nvmem->fixup_dt_cell_info(nvmem, &info);
  
 +              if (of_device_is_compatible(np, "fixed-layout")) {
 +                      if (of_device_is_compatible(child, "mac-base")) {