mirror of
https://github.com/torvalds/linux.git
synced 2026-05-01 04:52:32 -04:00
rpmsg: core: Make rpmsg_class constant
Since commit 43a7206b09 ("driver core: class: make class_register() take
a const *"), the driver core allows for struct class to be in read-only
memory, so move the rpmsg_class structure to be declared at build time
placing it into read-only memory, instead of having to be dynamically
allocated at boot time.
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Link: https://lore.kernel.org/r/20240305-class_cleanup-remoteproc-v1-1-19373374e003@marliere.net
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
This commit is contained in:
committed by
Mathieu Poirier
parent
4cece76496
commit
193d0c4e1e
@@ -150,7 +150,7 @@ static int rpmsg_ctrldev_probe(struct rpmsg_device *rpdev)
|
||||
dev = &ctrldev->dev;
|
||||
device_initialize(dev);
|
||||
dev->parent = &rpdev->dev;
|
||||
dev->class = rpmsg_class;
|
||||
dev->class = &rpmsg_class;
|
||||
|
||||
mutex_init(&ctrldev->ctrl_lock);
|
||||
cdev_init(&ctrldev->cdev, &rpmsg_ctrldev_fops);
|
||||
|
||||
Reference in New Issue
Block a user