[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1482751862-18699-1-git-send-email-bhumirks@gmail.com>
Date: Mon, 26 Dec 2016 17:01:02 +0530
From: Bhumika Goyal <bhumirks@...il.com>
To: julia.lawall@...6.fr, jason@...edaemon.net, andrew@...n.ch,
gregory.clement@...e-electrons.com,
sebastian.hesselbarth@...il.com, a.zummo@...ertech.it,
alexandre.belloni@...e-electrons.com,
linux-arm-kernel@...ts.infradead.org, rtc-linux@...glegroups.com,
linux-kernel@...r.kernel.org
Cc: keescook@...omium.org, Bhumika Goyal <bhumirks@...il.com>
Subject: [PATCH] rtc: armada38x: add __ro_after_init to armada38x_rtc_ops
The object armada38x_rtc_ops of type rtc_class_ops structure is not
modified after getting initialized by armada38x_rtc_probe. Apart from
getting referenced in init it is also passed as an argument to the function
devm_rtc_device_register but this argument is of type const struct
rtc_class_ops *. Therefore add __ro_after_init to its declaration.
Signed-off-by: Bhumika Goyal <bhumirks@...il.com>
---
drivers/rtc/rtc-armada38x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-armada38x.c b/drivers/rtc/rtc-armada38x.c
index 9a3f2a6..7883c7f 100644
--- a/drivers/rtc/rtc-armada38x.c
+++ b/drivers/rtc/rtc-armada38x.c
@@ -202,7 +202,7 @@ static irqreturn_t armada38x_rtc_alarm_irq(int irq, void *data)
return IRQ_HANDLED;
}
-static struct rtc_class_ops armada38x_rtc_ops = {
+static struct rtc_class_ops armada38x_rtc_ops __ro_after_init = {
.read_time = armada38x_rtc_read_time,
.set_time = armada38x_rtc_set_time,
.read_alarm = armada38x_rtc_read_alarm,
--
1.9.1
Powered by blists - more mailing lists