rtc: constify rtc_class_ops structures
authorBhumika Goyal <bhumirks@gmail.com>
Thu, 5 Jan 2017 16:55:05 +0000 (22:25 +0530)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Wed, 11 Jan 2017 16:23:06 +0000 (17:23 +0100)
commit8bc57e7f11971665b4a7886305dffcd27213d718
tree8e76735d0af7e67ff700dcd54a7e1af67ab5b86b
parenta734cc9ba37188f074f8b81125db05ca00d71d00
rtc: constify rtc_class_ops structures

Declare rtc_class_ops structures as const as they are only passed
as an argument to the function devm_rtc_device_register. This argument
is of type const struct rtc_class_ops *, so rtc_class_ops structures
having this property can be declared const.
Done using Coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct rtc_class_ops i@p = {...};

@ok1@
identifier r1.i;
position p;
@@
devm_rtc_device_register(...,&i@p,...)

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct rtc_class_ops i;

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-au1xxx.c
drivers/rtc/rtc-bfin.c
drivers/rtc/rtc-dm355evm.c
drivers/rtc/rtc-imxdi.c
drivers/rtc/rtc-ls1x.c
drivers/rtc/rtc-mxc.c
drivers/rtc/rtc-sh.c