2017-08-19 19:20:58

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 0/6] constify media i2c_device_id

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.

Arvind Yadav (6):
[PATCH 1/6] [media] ad9389b: constify i2c_device_id
[PATCH 2/6] [media] adv7511: constify i2c_device_id
[PATCH 3/6] [media] adv7842: constify i2c_device_id
[PATCH 4/6] [media] saa7127: constify i2c_device_id
[PATCH 5/6] [media] tc358743: constify i2c_device_id
[PATCH 6/6] [media] ths8200: constify i2c_device_id

drivers/media/i2c/ad9389b.c | 2 +-
drivers/media/i2c/adv7511.c | 2 +-
drivers/media/i2c/adv7842.c | 2 +-
drivers/media/i2c/saa7127.c | 2 +-
drivers/media/i2c/tc358743.c | 2 +-
drivers/media/i2c/ths8200.c | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)

--
2.7.4


2017-08-19 19:21:02

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 1/6] [media] ad9389b: constify i2c_device_id

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 <[email protected]>
---
drivers/media/i2c/ad9389b.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ad9389b.c b/drivers/media/i2c/ad9389b.c
index 50f3541..a056d6c 100644
--- a/drivers/media/i2c/ad9389b.c
+++ b/drivers/media/i2c/ad9389b.c
@@ -1208,7 +1208,7 @@ static int ad9389b_remove(struct i2c_client *client)

/* ----------------------------------------------------------------------- */

-static struct i2c_device_id ad9389b_id[] = {
+static const struct i2c_device_id ad9389b_id[] = {
{ "ad9389b", 0 },
{ "ad9889b", 0 },
{ }
--
2.7.4

2017-08-19 19:21:11

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 5/6] [media] tc358743: constify i2c_device_id

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 <[email protected]>
---
drivers/media/i2c/tc358743.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c
index 5788af2..e6f5c36 100644
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -2013,7 +2013,7 @@ static int tc358743_remove(struct i2c_client *client)
return 0;
}

-static struct i2c_device_id tc358743_id[] = {
+static const struct i2c_device_id tc358743_id[] = {
{"tc358743", 0},
{}
};
--
2.7.4

2017-08-19 19:21:19

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 6/6] [media] ths8200: constify i2c_device_id

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 <[email protected]>
---
drivers/media/i2c/ths8200.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c
index 42340e3..498ad23 100644
--- a/drivers/media/i2c/ths8200.c
+++ b/drivers/media/i2c/ths8200.c
@@ -483,7 +483,7 @@ static int ths8200_remove(struct i2c_client *client)
return 0;
}

-static struct i2c_device_id ths8200_id[] = {
+static const struct i2c_device_id ths8200_id[] = {
{ "ths8200", 0 },
{},
};
--
2.7.4

2017-08-19 19:21:07

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 3/6] [media] adv7842: constify i2c_device_id

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 <[email protected]>
---
drivers/media/i2c/adv7842.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c
index 303effd..9b959ec 100644
--- a/drivers/media/i2c/adv7842.c
+++ b/drivers/media/i2c/adv7842.c
@@ -3608,7 +3608,7 @@ static int adv7842_remove(struct i2c_client *client)

/* ----------------------------------------------------------------------- */

-static struct i2c_device_id adv7842_id[] = {
+static const struct i2c_device_id adv7842_id[] = {
{ "adv7842", 0 },
{ }
};
--
2.7.4

2017-08-19 19:21:51

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 4/6] [media] saa7127: constify i2c_device_id

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 <[email protected]>
---
drivers/media/i2c/saa7127.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/saa7127.c b/drivers/media/i2c/saa7127.c
index 99c3030..01784d4 100644
--- a/drivers/media/i2c/saa7127.c
+++ b/drivers/media/i2c/saa7127.c
@@ -806,7 +806,7 @@ static int saa7127_remove(struct i2c_client *client)

/* ----------------------------------------------------------------------- */

-static struct i2c_device_id saa7127_id[] = {
+static const struct i2c_device_id saa7127_id[] = {
{ "saa7127_auto", 0 }, /* auto-detection */
{ "saa7126", SAA7127 },
{ "saa7127", SAA7127 },
--
2.7.4

2017-08-19 19:22:16

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 2/6] [media] adv7511: constify i2c_device_id

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 <[email protected]>
---
drivers/media/i2c/adv7511.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/adv7511.c b/drivers/media/i2c/adv7511.c
index ccc4786..8fc97a8 100644
--- a/drivers/media/i2c/adv7511.c
+++ b/drivers/media/i2c/adv7511.c
@@ -1986,7 +1986,7 @@ static int adv7511_remove(struct i2c_client *client)

/* ----------------------------------------------------------------------- */

-static struct i2c_device_id adv7511_id[] = {
+static const struct i2c_device_id adv7511_id[] = {
{ "adv7511", 0 },
{ }
};
--
2.7.4