diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 51fd792b8d70..49b4bbaf59e8 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -17,6 +17,7 @@ #include #include #include +#include #include struct nvmem_device { @@ -761,6 +762,13 @@ static struct nvmem_layout *nvmem_layout_get(struct nvmem_device *nvmem) if (!layout_np) return NULL; + /* + * In case the nvmem device was built-in while the layout was built as a + * module, we shall manually request the layout driver loading otherwise + * we'll never have any match. + */ + of_request_module(layout_np); + spin_lock(&nvmem_layout_lock); list_for_each_entry(l, &nvmem_layouts, node) {