2017-08-19 18:47:49

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 0/3] constify iio 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 (3):
[PATCH 1/3] iio: accel: bma180: constify i2c_device_id
[PATCH 2/3] iio: light: apds9300: constify i2c_device_id
[PATCH 3/3] iio: light: tsl2583: constify i2c_device_id

drivers/iio/accel/bma180.c | 2 +-
drivers/iio/light/apds9300.c | 2 +-
drivers/iio/light/tsl2583.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

--
2.7.4


2017-08-19 18:47:56

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 2/3] iio: light: apds9300: 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/iio/light/apds9300.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/light/apds9300.c b/drivers/iio/light/apds9300.c
index 649b26f..05eacd1 100644
--- a/drivers/iio/light/apds9300.c
+++ b/drivers/iio/light/apds9300.c
@@ -505,7 +505,7 @@ static SIMPLE_DEV_PM_OPS(apds9300_pm_ops, apds9300_suspend, apds9300_resume);
#define APDS9300_PM_OPS NULL
#endif

-static struct i2c_device_id apds9300_id[] = {
+static const struct i2c_device_id apds9300_id[] = {
{ APDS9300_DRV_NAME, 0 },
{ }
};
--
2.7.4

2017-08-19 18:48:05

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 3/3] iio: light: tsl2583: 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/iio/light/tsl2583.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/light/tsl2583.c b/drivers/iio/light/tsl2583.c
index 1679181..fb711ed 100644
--- a/drivers/iio/light/tsl2583.c
+++ b/drivers/iio/light/tsl2583.c
@@ -924,7 +924,7 @@ static const struct dev_pm_ops tsl2583_pm_ops = {
SET_RUNTIME_PM_OPS(tsl2583_suspend, tsl2583_resume, NULL)
};

-static struct i2c_device_id tsl2583_idtable[] = {
+static const struct i2c_device_id tsl2583_idtable[] = {
{ "tsl2580", 0 },
{ "tsl2581", 1 },
{ "tsl2583", 2 },
--
2.7.4

2017-08-19 18:47:52

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 1/3] iio: accel: bma180: 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/iio/accel/bma180.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c
index efc6773..3dec972 100644
--- a/drivers/iio/accel/bma180.c
+++ b/drivers/iio/accel/bma180.c
@@ -842,7 +842,7 @@ static SIMPLE_DEV_PM_OPS(bma180_pm_ops, bma180_suspend, bma180_resume);
#define BMA180_PM_OPS NULL
#endif

-static struct i2c_device_id bma180_ids[] = {
+static const struct i2c_device_id bma180_ids[] = {
{ "bma180", BMA180 },
{ "bma250", BMA250 },
{ }
--
2.7.4

2017-08-20 09:17:44

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 1/3] iio: accel: bma180: constify i2c_device_id

On Sun, 20 Aug 2017 00:17:36 +0530
Arvind Yadav <[email protected]> wrote:

> 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]>
Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.

Thanks,

Jonathan
> ---
> drivers/iio/accel/bma180.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c
> index efc6773..3dec972 100644
> --- a/drivers/iio/accel/bma180.c
> +++ b/drivers/iio/accel/bma180.c
> @@ -842,7 +842,7 @@ static SIMPLE_DEV_PM_OPS(bma180_pm_ops, bma180_suspend, bma180_resume);
> #define BMA180_PM_OPS NULL
> #endif
>
> -static struct i2c_device_id bma180_ids[] = {
> +static const struct i2c_device_id bma180_ids[] = {
> { "bma180", BMA180 },
> { "bma250", BMA250 },
> { }

2017-08-20 09:17:46

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 2/3] iio: light: apds9300: constify i2c_device_id

On Sun, 20 Aug 2017 00:17:37 +0530
Arvind Yadav <[email protected]> wrote:

> 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]>
Applied.

Thanks,

Jonathan
> ---
> drivers/iio/light/apds9300.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/light/apds9300.c b/drivers/iio/light/apds9300.c
> index 649b26f..05eacd1 100644
> --- a/drivers/iio/light/apds9300.c
> +++ b/drivers/iio/light/apds9300.c
> @@ -505,7 +505,7 @@ static SIMPLE_DEV_PM_OPS(apds9300_pm_ops, apds9300_suspend, apds9300_resume);
> #define APDS9300_PM_OPS NULL
> #endif
>
> -static struct i2c_device_id apds9300_id[] = {
> +static const struct i2c_device_id apds9300_id[] = {
> { APDS9300_DRV_NAME, 0 },
> { }
> };

2017-08-20 09:17:59

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 3/3] iio: light: tsl2583: constify i2c_device_id

On Sun, 20 Aug 2017 00:17:38 +0530
Arvind Yadav <[email protected]> wrote:

> 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]>
Applied.

Thanks,

Jonathan
> ---
> drivers/iio/light/tsl2583.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/light/tsl2583.c b/drivers/iio/light/tsl2583.c
> index 1679181..fb711ed 100644
> --- a/drivers/iio/light/tsl2583.c
> +++ b/drivers/iio/light/tsl2583.c
> @@ -924,7 +924,7 @@ static const struct dev_pm_ops tsl2583_pm_ops = {
> SET_RUNTIME_PM_OPS(tsl2583_suspend, tsl2583_resume, NULL)
> };
>
> -static struct i2c_device_id tsl2583_idtable[] = {
> +static const struct i2c_device_id tsl2583_idtable[] = {
> { "tsl2580", 0 },
> { "tsl2581", 1 },
> { "tsl2583", 2 },