Skip to content

Commit a28885b

Browse files
Uwe Kleine-Königtorvalds
authored andcommitted
rtc: make of_device_ids const
of_device_ids (i.e. compatible strings and the respective data) are not supposed to change at runtime. All functions working with of_device_ids provided by <linux/of.h> work with const of_device_ids. This allows to mark all struct of_device_id below drivers/rtc const, too. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 7823047 commit a28885b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/rtc/rtc-isl12022.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ static int isl12022_probe(struct i2c_client *client,
274274
}
275275

276276
#ifdef CONFIG_OF
277-
static struct of_device_id isl12022_dt_match[] = {
277+
static const struct of_device_id isl12022_dt_match[] = {
278278
{ .compatible = "isl,isl12022" },
279279
{ },
280280
};

‎drivers/rtc/rtc-mpc5121.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ static int mpc5121_rtc_remove(struct platform_device *op)
401401
}
402402

403403
#ifdef CONFIG_OF
404-
static struct of_device_id mpc5121_rtc_match[] = {
404+
static const struct of_device_id mpc5121_rtc_match[] = {
405405
{ .compatible = "fsl,mpc5121-rtc", },
406406
{ .compatible = "fsl,mpc5200-rtc", },
407407
{},

0 commit comments

Comments
 (0)