The data_year_param struct is never modified, so lets constify it.
This permit to remove cast since of_device_id is const also.
Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
unsigned char leap_shift; /* bit shift to get the leap year */
};
-static struct sunxi_rtc_data_year data_year_param[] = {
+static const struct sunxi_rtc_data_year data_year_param[] = {
[0] = {
.min = 2010,
.max = 2073,
struct sunxi_rtc_dev {
struct rtc_device *rtc;
struct device *dev;
- struct sunxi_rtc_data_year *data_year;
+ const struct sunxi_rtc_data_year *data_year;
void __iomem *base;
int irq;
};
dev_err(&pdev->dev, "Unable to setup RTC data\n");
return -ENODEV;
}
- chip->data_year = (struct sunxi_rtc_data_year *) of_id->data;
+ chip->data_year = of_id->data;
/* clear the alarm count value */
writel(0, chip->base + SUNXI_ALRM_DHMS);