Skip to content

Commit c4c23f5

Browse files
JuliaLawallalexandrebelloni
authored andcommitted
rtc: rtc-ds2404: constify ds2404_chip_ops structures
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>
1 parent 8ae83b6 commit c4c23f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/rtc/rtc-ds2404.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct ds2404_gpio {
4848

4949
struct ds2404 {
5050
struct ds2404_gpio *gpio;
51-
struct ds2404_chip_ops *ops;
51+
const struct ds2404_chip_ops *ops;
5252
struct rtc_device *rtc;
5353
};
5454

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

98-
static struct ds2404_chip_ops ds2404_gpio_ops = {
98+
static const struct ds2404_chip_ops ds2404_gpio_ops = {
9999
.map_io = ds2404_gpio_map,
100100
.unmap_io = ds2404_gpio_unmap,
101101
};

0 commit comments

Comments
 (0)