nvmem: layouts: fix automatic module loading
Subsystems (2)
PATCH v2 1/1 nvmem: layouts: fix automatic module loading
To support loading of a layout module automatically the MODALIAS variable in the uevent is needed. Add it.
---
I'm still not sure if the sysfs modalias file is required or not. It seems to work without it. I could't find any documentation about it.
v2:
- add Cc: stable
--- drivers/nvmem/layouts.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/nvmem/layouts.c +13 -0
@@ -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,
Signature · 1 line
2.39.5
Hello,
Quoted 9 lines · Michael Walle
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")Signed-off-by Michael Walle <[email protected]>---
I'm still not sure if the sysfs modalias file is required or not. It seems to work without it. I could't find any documentation about it.
I do not recall how this worked on my side, nor if it actually did with the latest version (there's been a version where module loading was requested in kernel code, and this was working well with an initamfs IIRC), but that change sound reasonable.
Thanks,
Miquèl
Quoted 4 lines · Michael Walle
To support loading of a layout module automatically the MODALIAS variable in the uevent is needed. Add it.
Applied, thanks!
[1/1] nvmem: layouts: fix automatic module loading
commit: cc6f2b728cd06402127fb24df3c1c0e6f48c80c4
Best regards,
Signature · 1 line
Srinivas Kandagatla <[email protected]>