rtc: st-lpc: Constify st_rtc_ops
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Sun, 13 Sep 2020 12:26:44 +0000 (14:26 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 15 Sep 2020 09:21:50 +0000 (11:21 +0200)
The only usage of st_rtc_ops is to assign its address to the ops field
in the rtc_device struct. which is a const pointer. Make it const to
allow the compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20200913122644.35515-1-rikard.falkeborn@gmail.com
drivers/rtc/rtc-st-lpc.c

index 51041dc08af4b479443c96b6579cb1cb0e87b860..0c65448b85eef9bf0f8b8fa0b424ca8984277c33 100644 (file)
@@ -173,7 +173,7 @@ static int st_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *t)
        return 0;
 }
 
-static struct rtc_class_ops st_rtc_ops = {
+static const struct rtc_class_ops st_rtc_ops = {
        .read_time              = st_rtc_read_time,
        .set_time               = st_rtc_set_time,
        .read_alarm             = st_rtc_read_alarm,