mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-21 04:53:46 -04:00
rtc: class: make rtc_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 rtc_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-abelloni-v1-1-944c026137c8@marliere.net
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
committed by
Alexandre Belloni
parent
32a6be0858
commit
6b6ca09611
@@ -696,7 +696,7 @@ struct rtc_device *rtc_class_open(const char *name)
|
||||
struct device *dev;
|
||||
struct rtc_device *rtc = NULL;
|
||||
|
||||
dev = class_find_device_by_name(rtc_class, name);
|
||||
dev = class_find_device_by_name(&rtc_class, name);
|
||||
if (dev)
|
||||
rtc = to_rtc_device(dev);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user