]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
nvmem: layouts: fix automatic module loading
authorMichael Walle <mwalle@kernel.org>
Fri, 12 Sep 2025 13:13:47 +0000 (14:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 12 Oct 2025 11:01:03 +0000 (13:01 +0200)
commit 810b790033ccc795d55cbef3927668fd01efdfdf upstream.

To support loading of a layout module automatically the MODALIAS
variable in the uevent is needed. Add it.

Fixes: fc29fd821d9a ("nvmem: core: Rework layouts to become regular devices")
Cc: stable@vger.kernel.org
Signed-off-by: Michael Walle <mwalle@kernel.org>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
Link: https://lore.kernel.org/r/20250912131347.303345-2-srini@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvmem/layouts.c

index 65d39e19f6eca40f138f228653a8a48ab290caae..f381ce1e84bd37dc9bb5a6a4c45773d6aa4d9cb8 100644 (file)
@@ -45,11 +45,24 @@ static void nvmem_layout_bus_remove(struct device *dev)
        return drv->remove(layout);
 }
 
+static int nvmem_layout_bus_uevent(const struct device *dev,
+                                  struct kobj_uevent_env *env)
+{
+       int ret;
+
+       ret = of_device_uevent_modalias(dev, env);
+       if (ret != ENODEV)
+               return ret;
+
+       return 0;
+}
+
 static const struct bus_type nvmem_layout_bus_type = {
        .name           = "nvmem-layout",
        .match          = nvmem_layout_bus_match,
        .probe          = nvmem_layout_bus_probe,
        .remove         = nvmem_layout_bus_remove,
+       .uevent         = nvmem_layout_bus_uevent,
 };
 
 int __nvmem_layout_driver_register(struct nvmem_layout_driver *drv,