[PATCH] nvmem: s32g-ocotp: add OF module alias for autoloading

Can Peng posted 1 patch 1 week, 3 days ago
There is a newer version of this series
drivers/nvmem/s32g-ocotp-nvmem.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] nvmem: s32g-ocotp: add OF module alias for autoloading
Posted by Can Peng 1 week, 3 days ago
The S32G OCOTP platform driver can be built as a module and uses
ocotp_of_match as its OF match table, but the table is not exported for
module alias generation.

Add the MODULE_DEVICE_TABLE(of, ...) entry so modpost can generate OF
module aliases for OF based module autoloading.

Fixes: 5a356145e968 ("nvmem: s32g-ocotp: Add driver for S32G OCOTP")
Signed-off-by: Can Peng <pengcan@kylinos.cn>
---
 drivers/nvmem/s32g-ocotp-nvmem.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvmem/s32g-ocotp-nvmem.c b/drivers/nvmem/s32g-ocotp-nvmem.c
index 119871ab3a94..0b57d1b36f29 100644
--- a/drivers/nvmem/s32g-ocotp-nvmem.c
+++ b/drivers/nvmem/s32g-ocotp-nvmem.c
@@ -60,6 +60,7 @@ static const struct of_device_id ocotp_of_match[] = {
 	{ .compatible = "nxp,s32g2-ocotp" },
 	{ /* sentinel */ }
 };
+MODULE_DEVICE_TABLE(of, ocotp_of_match);
 
 static int s32g_ocotp_probe(struct platform_device *pdev)
 {
-- 
2.53.0
Re: [PATCH] nvmem: s32g-ocotp: add OF module alias for autoloading
Posted by Srinivas Kandagatla 1 week, 1 day ago

On 7/15/26 2:10 AM, Can Peng wrote:
> The S32G OCOTP platform driver can be built as a module and uses
> ocotp_of_match as its OF match table, but the table is not exported for
> module alias generation.
> 
> Add the MODULE_DEVICE_TABLE(of, ...) entry so modpost can generate OF
> module aliases for OF based module autoloading.
> 
> Fixes: 5a356145e968 ("nvmem: s32g-ocotp: Add driver for S32G OCOTP")

CC Stable is missing

--srini
> Signed-off-by: Can Peng <pengcan@kylinos.cn>
> ---
>  drivers/nvmem/s32g-ocotp-nvmem.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/nvmem/s32g-ocotp-nvmem.c b/drivers/nvmem/s32g-ocotp-nvmem.c
> index 119871ab3a94..0b57d1b36f29 100644
> --- a/drivers/nvmem/s32g-ocotp-nvmem.c
> +++ b/drivers/nvmem/s32g-ocotp-nvmem.c
> @@ -60,6 +60,7 @@ static const struct of_device_id ocotp_of_match[] = {
>  	{ .compatible = "nxp,s32g2-ocotp" },
>  	{ /* sentinel */ }
>  };
> +MODULE_DEVICE_TABLE(of, ocotp_of_match);
>  
>  static int s32g_ocotp_probe(struct platform_device *pdev)
>  {