diff options
author | 2024-03-05 15:22:28 -0300 | |
---|---|---|
committer | 2024-03-08 12:05:10 +0100 | |
commit | 6b6ca096115e5b7a85e8313f4e68a72d52db91b3 (patch) | |
tree | 09390476f578e91e4b2e4a33a5277fde7eb8f22f /include/linux/rtc.h | |
parent | dt-bindings: rtc: abx80x: Improve checks on trickle charger constraints (diff) | |
download | wireguard-linux-6b6ca096115e5b7a85e8313f4e68a72d52db91b3.tar.xz wireguard-linux-6b6ca096115e5b7a85e8313f4e68a72d52db91b3.zip |
rtc: class: make rtc_class constant
Since commit 43a7206b0963 ("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>
Diffstat (limited to 'include/linux/rtc.h')
-rw-r--r-- | include/linux/rtc.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 5f8e438a0312..3f4d315aaec9 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h @@ -42,7 +42,7 @@ static inline time64_t rtc_tm_sub(struct rtc_time *lhs, struct rtc_time *rhs) #include <linux/timerqueue.h> #include <linux/workqueue.h> -extern struct class *rtc_class; +extern const struct class rtc_class; /* * For these RTC methods the device parameter is the physical device |