Skip to content

Commit

Permalink
rtc: sunxi: constify the data_year_param structure
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Chen-Yu Tsai <[email protected]>
Signed-off-by: Alexandre Belloni <[email protected]>
  • Loading branch information
montjoie authored and alexandrebelloni committed Jan 11, 2016
1 parent f8947fe commit 6ddab92
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/rtc/rtc-sunxi.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ struct sunxi_rtc_data_year {
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,
Expand All @@ -151,7 +151,7 @@ static struct sunxi_rtc_data_year data_year_param[] = {
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;
};
Expand Down Expand Up @@ -468,7 +468,7 @@ static int sunxi_rtc_probe(struct platform_device *pdev)
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);
Expand Down

0 comments on commit 6ddab92

Please sign in to comment.