]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
rtc: constify i2c_device_id
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Sat, 19 Aug 2017 19:07:55 +0000 (00:37 +0530)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Thu, 31 Aug 2017 23:10:11 +0000 (01:10 +0200)
i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by <linux/i2c.h> work with
const i2c_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-ds1672.c
drivers/rtc/rtc-em3027.c
drivers/rtc/rtc-max6900.c
drivers/rtc/rtc-rv3029c2.c

index 7bf46bfe11a44a71a5d0067843283acad8979c1c..9caaccccaa575f41fb3280f3753d8dea8ec3c9db 100644 (file)
@@ -190,7 +190,7 @@ static int ds1672_probe(struct i2c_client *client,
        return 0;
 }
 
-static struct i2c_device_id ds1672_id[] = {
+static const struct i2c_device_id ds1672_id[] = {
        { "ds1672", 0 },
        { }
 };
index 4f4930a2004caa03d899b874b34081cc2d778907..b0ef8cfe742d4fa8c9c732187e7ad9d9a81fc987 100644 (file)
@@ -132,7 +132,7 @@ static int em3027_probe(struct i2c_client *client,
        return 0;
 }
 
-static struct i2c_device_id em3027_id[] = {
+static const struct i2c_device_id em3027_id[] = {
        { "em3027", 0 },
        { }
 };
index 48b6b411f8b24802566d522092efd67af00355cb..cbdc86a560bafd6b35eeb94aef65e5aa2f00f01e 100644 (file)
@@ -226,7 +226,7 @@ max6900_probe(struct i2c_client *client, const struct i2c_device_id *id)
        return 0;
 }
 
-static struct i2c_device_id max6900_id[] = {
+static const struct i2c_device_id max6900_id[] = {
        { "max6900", 0 },
        { }
 };
index 85fa1da03762cafd4991bfbf6e2aab421532a475..aa09771de04f764cff457180ef090bb2f052d632 100644 (file)
@@ -868,7 +868,7 @@ static int rv3029_i2c_probe(struct i2c_client *client,
        return rv3029_probe(&client->dev, regmap, client->irq, client->name);
 }
 
-static struct i2c_device_id rv3029_id[] = {
+static const struct i2c_device_id rv3029_id[] = {
        { "rv3029", 0 },
        { "rv3029c2", 0 },
        { }