]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rpmsg: char: Export alias for RPMSG ID rpmsg-raw from table
authorAndrew Davis <afd@ti.com>
Thu, 19 Jun 2025 20:57:22 +0000 (15:57 -0500)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Mon, 25 Aug 2025 14:20:21 +0000 (08:20 -0600)
Module aliases are used by userspace to identify the correct module to
load for a detected hardware. The currently supported RPMSG device IDs for
this module include "rpmsg-raw", but the module alias is "rpmsg_chrdev".

Use the helper macro MODULE_DEVICE_TABLE(rpmsg) to export the correct
supported IDs. And while here, to keep backwards compatibility we also add
the other ID "rpmsg_chrdev" so that it is also still exported as an alias.

This has the side benefit of adding support for some legacy firmware
which still uses the original "rpmsg_chrdev" ID. This was the ID used for
this driver before it was upstreamed (as reflected by the module alias).

Signed-off-by: Andrew Davis <afd@ti.com>
Acked-by: Hari Nagalla <hnagalla@ti.com>
Tested-by: Hari Nagalla <hnagalla@ti.com>
Link: https://lore.kernel.org/r/20250619205722.133827-1-afd@ti.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
drivers/rpmsg/rpmsg_char.c

index eec7642d26863a8f12a4dcb1a8e3f59de6d04fcb..96fcdd2d7093c285565a2b62af99395635d4191f 100644 (file)
@@ -522,8 +522,10 @@ static void rpmsg_chrdev_remove(struct rpmsg_device *rpdev)
 
 static struct rpmsg_device_id rpmsg_chrdev_id_table[] = {
        { .name = "rpmsg-raw" },
+       { .name = "rpmsg_chrdev" },
        { },
 };
+MODULE_DEVICE_TABLE(rpmsg, rpmsg_chrdev_id_table);
 
 static struct rpmsg_driver rpmsg_chrdev_driver = {
        .probe = rpmsg_chrdev_probe,
@@ -565,6 +567,5 @@ static void rpmsg_chrdev_exit(void)
 }
 module_exit(rpmsg_chrdev_exit);
 
-MODULE_ALIAS("rpmsg:rpmsg_chrdev");
 MODULE_DESCRIPTION("RPMSG device interface");
 MODULE_LICENSE("GPL v2");