ALSA: i2c: constify snd_i2c_ops structures
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sun, 29 Nov 2015 17:25:24 +0000 (18:25 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 30 Nov 2015 10:40:08 +0000 (11:40 +0100)
The snd_i2c_ops structures are never modified, so declare them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/i2c.h
sound/i2c/i2c.c
sound/pci/ice1712/delta.c

index d125ff8c85e851888b82fee527d9aebb004bed6b..835254de20391f0594b1fb772c5fa8352b7d9b3a 100644 (file)
@@ -66,7 +66,7 @@ struct snd_i2c_bus {
                struct snd_i2c_bit_ops *bit;
                void *ops;
        } hw_ops;               /* lowlevel operations */
-       struct snd_i2c_ops *ops;        /* midlevel operations */
+       const struct snd_i2c_ops *ops;  /* midlevel operations */
 
        unsigned long private_value;
        void *private_data;
index 4677037f0c8e4710fe020c8a5c71b1a971555b37..ef2a9afe9e198b225da0af703bfd122261c04499 100644 (file)
@@ -39,7 +39,7 @@ static int snd_i2c_bit_readbytes(struct snd_i2c_device *device,
 static int snd_i2c_bit_probeaddr(struct snd_i2c_bus *bus,
                                 unsigned short addr);
 
-static struct snd_i2c_ops snd_i2c_bit_ops = {
+static const struct snd_i2c_ops snd_i2c_bit_ops = {
        .sendbytes = snd_i2c_bit_sendbytes,
        .readbytes = snd_i2c_bit_readbytes,
        .probeaddr = snd_i2c_bit_probeaddr,
index 496dbd0ad5dbb3247c7845b21de7a37b2fd11d3d..3bfdc78cbc5f94b2f2f244c3f05ed1b36a224cbb 100644 (file)
@@ -174,7 +174,7 @@ static int ap_cs8427_probeaddr(struct snd_i2c_bus *bus, unsigned short addr)
        return -ENOENT;
 }
 
-static struct snd_i2c_ops ap_cs8427_i2c_ops = {
+static const struct snd_i2c_ops ap_cs8427_i2c_ops = {
        .sendbytes = ap_cs8427_sendbytes,
        .readbytes = ap_cs8427_readbytes,
        .probeaddr = ap_cs8427_probeaddr,