Skip to content

Commit

Permalink
rpmsg: char: Add device id_table for auto-probe
Browse files Browse the repository at this point in the history
commit 16f94e5647161bea945daa3d991fc60bd9a4a199 from
git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git

The rpmsg char driver is not auto-probed for any rpmsg device
without relying on the device's driver_override feature. Add a
device id_table to the rpmsg-char driver to facilitate this
auto-probe. Any rpmsg device with the name "rpmsg_chrdev" will
be auto-probed to begin with.

The driver_override will continue to work just fine as well.

Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Subhajit Paul <subhajit_paul@ti.com>
Signed-off-by: Xulin Sun <xulin.sun@windriver.com>
  • Loading branch information
sumananna authored and xulinsun committed Dec 1, 2020
1 parent 7c0bc39 commit eeccaa7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/rpmsg/rpmsg_char.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,12 +536,19 @@ static void rpmsg_chrdev_remove(struct rpmsg_device *rpdev)
put_device(&ctrldev->dev);
}

static const struct rpmsg_device_id rpmsg_char_id_table[] = {
{ .name = "rpmsg_chrdev" },
{ },
};
MODULE_DEVICE_TABLE(rpmsg, rpmsg_char_id_table);

static struct rpmsg_driver rpmsg_chrdev_driver = {
.probe = rpmsg_chrdev_probe,
.remove = rpmsg_chrdev_remove,
.drv = {
.name = "rpmsg_chrdev",
},
.id_table = rpmsg_char_id_table,
};

static int rpmsg_char_init(void)
Expand Down

0 comments on commit eeccaa7

Please sign in to comment.