Skip to content

Commit

Permalink
rtc: rtc-ds2404: constify ds2404_chip_ops structures
Browse files Browse the repository at this point in the history
The ds2404_chip_ops structure is never modified, so declare it as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
  • Loading branch information
Julia Lawall authored and Alexandre Belloni committed Jan 11, 2016
1 parent 8ae83b6 commit c4c23f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/rtc/rtc-ds2404.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct ds2404_gpio {

struct ds2404 {
struct ds2404_gpio *gpio;
struct ds2404_chip_ops *ops;
const struct ds2404_chip_ops *ops;
struct rtc_device *rtc;
};

Expand Down Expand Up @@ -95,7 +95,7 @@ static void ds2404_gpio_unmap(struct ds2404 *chip)
gpio_free(ds2404_gpio[i].gpio);
}

static struct ds2404_chip_ops ds2404_gpio_ops = {
static const struct ds2404_chip_ops ds2404_gpio_ops = {
.map_io = ds2404_gpio_map,
.unmap_io = ds2404_gpio_unmap,
};
Expand Down

0 comments on commit c4c23f5

Please sign in to comment.