media: pci: make i2c_adapter const
authorBhumika Goyal <bhumirks@gmail.com>
Sat, 19 Aug 2017 10:34:13 +0000 (06:34 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Sat, 26 Aug 2017 12:41:15 +0000 (08:41 -0400)
Make these const as they are only used in a copy operation.
Done using Coccinelle

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/pci/cobalt/cobalt-i2c.c
drivers/media/pci/cx18/cx18-i2c.c
drivers/media/pci/cx23885/cx23885-i2c.c
drivers/media/pci/cx25821/cx25821-i2c.c
drivers/media/pci/ivtv/ivtv-i2c.c
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c
drivers/media/pci/saa7134/saa7134-i2c.c
drivers/media/pci/saa7164/saa7164-i2c.c

index ad16b89b8d0ce44f1e76795047da2451184eb66b..1a5c55673ea859e2684159f6d92cabd2a7aa8441 100644 (file)
@@ -301,7 +301,7 @@ static u32 cobalt_func(struct i2c_adapter *adap)
 }
 
 /* template for i2c-bit-algo */
-static struct i2c_adapter cobalt_i2c_adap_template = {
+static const struct i2c_adapter cobalt_i2c_adap_template = {
        .name = "cobalt i2c driver",
        .algo = NULL,                   /* set by i2c-algo-bit */
        .algo_data = NULL,              /* filled from template */
index b89fbcbfb4918085af02c93eace902f7107193cb..af56d56eae089a21c7641f8440bac1bcc35f5149 100644 (file)
@@ -206,7 +206,7 @@ static int cx18_getsda(void *data)
 }
 
 /* template for i2c-bit-algo */
-static struct i2c_adapter cx18_i2c_adap_template = {
+static const struct i2c_adapter cx18_i2c_adap_template = {
        .name = "cx18 i2c driver",
        .algo = NULL,                   /* set by i2c-algo-bit */
        .algo_data = NULL,              /* filled from template */
index 8528032090f296d5b32428e27c17d2f51acbf5e3..0f21467ae88eba43c5aa80f0582965935b27e120 100644 (file)
@@ -264,7 +264,7 @@ static const struct i2c_algorithm cx23885_i2c_algo_template = {
 
 /* ----------------------------------------------------------------------- */
 
-static struct i2c_adapter cx23885_i2c_adap_template = {
+static const struct i2c_adapter cx23885_i2c_adap_template = {
        .name              = "cx23885",
        .owner             = THIS_MODULE,
        .algo              = &cx23885_i2c_algo_template,
index 263a1cf36ef1c8370bd33a0b5332ea2f0f812c82..000049d3c71bca01965fbf86c48913eaf6d67490 100644 (file)
@@ -285,7 +285,7 @@ static const struct i2c_algorithm cx25821_i2c_algo_template = {
 #endif
 };
 
-static struct i2c_adapter cx25821_i2c_adap_template = {
+static const struct i2c_adapter cx25821_i2c_adap_template = {
        .name = "cx25821",
        .owner = THIS_MODULE,
        .algo = &cx25821_i2c_algo_template,
index 69b4fa6f0362488459776f17c55d7fba587ec1a2..5a35e366f4c08f97802b1bc4357b8e64616c718a 100644 (file)
@@ -632,7 +632,7 @@ static const struct i2c_algorithm ivtv_algo = {
 };
 
 /* template for our-bit banger */
-static struct i2c_adapter ivtv_i2c_adap_hw_template = {
+static const struct i2c_adapter ivtv_i2c_adap_hw_template = {
        .name = "ivtv i2c driver",
        .algo = &ivtv_algo,
        .algo_data = NULL,                      /* filled from template */
@@ -682,7 +682,7 @@ static int ivtv_getsda_old(void *data)
 }
 
 /* template for i2c-bit-algo */
-static struct i2c_adapter ivtv_i2c_adap_template = {
+static const struct i2c_adapter ivtv_i2c_adap_template = {
        .name = "ivtv i2c driver",
        .algo = NULL,                   /* set by i2c-algo-bit */
        .algo_data = NULL,              /* filled from template */
index b49e4f9788e8693ebdafd30f90124fde928f9619..b13e319d24b7af51f2642b1730c1f336a2c52157 100644 (file)
@@ -300,7 +300,7 @@ static const struct i2c_algorithm netup_i2c_algorithm = {
        .functionality  = netup_i2c_func,
 };
 
-static struct i2c_adapter netup_i2c_adapter = {
+static const struct i2c_adapter netup_i2c_adapter = {
        .owner          = THIS_MODULE,
        .name           = NETUP_UNIDVB_NAME,
        .class          = I2C_CLASS_HWMON | I2C_CLASS_SPD,
index 9d0e69eae036fafe8e2001a330a7139174f8b1f9..8f2ed632840f7bb85dc048f34cfdefe6270ae92e 100644 (file)
@@ -339,7 +339,7 @@ static const struct i2c_algorithm saa7134_algo = {
        .functionality = functionality,
 };
 
-static struct i2c_adapter saa7134_adap_template = {
+static const struct i2c_adapter saa7134_adap_template = {
        .owner         = THIS_MODULE,
        .name          = "saa7134",
        .algo          = &saa7134_algo,
index 430f6789f222cc9573695177abd56e4bea99f7f9..4bcde7c79dc382fc8a094b1c539748acf3fdd18a 100644 (file)
@@ -78,7 +78,7 @@ static const struct i2c_algorithm saa7164_i2c_algo_template = {
 
 /* ----------------------------------------------------------------------- */
 
-static struct i2c_adapter saa7164_i2c_adap_template = {
+static const struct i2c_adapter saa7164_i2c_adap_template = {
        .name              = "saa7164",
        .owner             = THIS_MODULE,
        .algo              = &saa7164_i2c_algo_template,