Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rpmsg: char: Export alias for RPMSG ID rpmsg-raw from table

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>

authored by

Andrew Davis and committed by
Mathieu Poirier
6e29c30d c17b750b

+2 -1
+2 -1
drivers/rpmsg/rpmsg_char.c
··· 522 522 523 523 static struct rpmsg_device_id rpmsg_chrdev_id_table[] = { 524 524 { .name = "rpmsg-raw" }, 525 + { .name = "rpmsg_chrdev" }, 525 526 { }, 526 527 }; 528 + MODULE_DEVICE_TABLE(rpmsg, rpmsg_chrdev_id_table); 527 529 528 530 static struct rpmsg_driver rpmsg_chrdev_driver = { 529 531 .probe = rpmsg_chrdev_probe, ··· 567 565 } 568 566 module_exit(rpmsg_chrdev_exit); 569 567 570 - MODULE_ALIAS("rpmsg:rpmsg_chrdev"); 571 568 MODULE_DESCRIPTION("RPMSG device interface"); 572 569 MODULE_LICENSE("GPL v2");