net: dsa: b53: constify b53_io_ops structures
authorJulia Lawall <julia.lawall@lip6.fr>
Tue, 9 Aug 2016 17:09:45 +0000 (19:09 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 Aug 2016 22:09:40 +0000 (15:09 -0700)
The b53_io_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>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/b53/b53_common.c
drivers/net/dsa/b53/b53_mdio.c
drivers/net/dsa/b53/b53_mmap.c
drivers/net/dsa/b53/b53_priv.h
drivers/net/dsa/b53/b53_spi.c
drivers/net/dsa/b53/b53_srab.c

index bda37d336736ef3ee845ade74cef63bcccf459fc..38ee10de78844c8462062a59f0ed7ec3d4c2d075 100644 (file)
@@ -1681,7 +1681,8 @@ static int b53_switch_init(struct b53_device *dev)
        return 0;
 }
 
-struct b53_device *b53_switch_alloc(struct device *base, struct b53_io_ops *ops,
+struct b53_device *b53_switch_alloc(struct device *base,
+                                   const struct b53_io_ops *ops,
                                    void *priv)
 {
        struct dsa_switch *ds;
index aa87c3fffdac2829ff9c7cf429372fc81d1b0110..477a16b5660ab61f7bda3dce2438d95b5806513c 100644 (file)
@@ -267,7 +267,7 @@ static int b53_mdio_phy_write16(struct b53_device *dev, int addr, int reg,
        return mdiobus_write_nested(bus, addr, reg, value);
 }
 
-static struct b53_io_ops b53_mdio_ops = {
+static const struct b53_io_ops b53_mdio_ops = {
        .read8 = b53_mdio_read8,
        .read16 = b53_mdio_read16,
        .read32 = b53_mdio_read32,
index 77ffc431280855adee1604668ab84ebd9bb07a76..cc9e6bd83e0e5151b3ad4736b3bfe3d5fc2c2cc9 100644 (file)
@@ -208,7 +208,7 @@ static int b53_mmap_write64(struct b53_device *dev, u8 page, u8 reg,
        return 0;
 }
 
-static struct b53_io_ops b53_mmap_ops = {
+static const struct b53_io_ops b53_mmap_ops = {
        .read8 = b53_mmap_read8,
        .read16 = b53_mmap_read16,
        .read32 = b53_mmap_read32,
index 835a744f206e8b35745e4f465c2b08c43bfaddf4..d268493a5feca3f0d415497d2d747968f2e245b1 100644 (file)
@@ -182,7 +182,8 @@ static inline int is_cpu_port(struct b53_device *dev, int port)
        return dev->cpu_port;
 }
 
-struct b53_device *b53_switch_alloc(struct device *base, struct b53_io_ops *ops,
+struct b53_device *b53_switch_alloc(struct device *base,
+                                   const struct b53_io_ops *ops,
                                    void *priv);
 
 int b53_switch_detect(struct b53_device *dev);
index 2bda0b5f15787ae1892255c70b84b6dfa25980b3..1c847a161bbd3ef9330aedf1a190923b1512920b 100644 (file)
@@ -270,7 +270,7 @@ static int b53_spi_write64(struct b53_device *dev, u8 page, u8 reg, u64 value)
        return spi_write(spi, txbuf, sizeof(txbuf));
 }
 
-static struct b53_io_ops b53_spi_ops = {
+static const struct b53_io_ops b53_spi_ops = {
        .read8 = b53_spi_read8,
        .read16 = b53_spi_read16,
        .read32 = b53_spi_read32,
index 3e2d4a5fcd5ae2c4175343712037e0a03dfa54e3..8a62b6a6970374a328acc36fe513f4e3ce0fb285 100644 (file)
@@ -344,7 +344,7 @@ err:
        return ret;
 }
 
-static struct b53_io_ops b53_srab_ops = {
+static const struct b53_io_ops b53_srab_ops = {
        .read8 = b53_srab_read8,
        .read16 = b53_srab_read16,
        .read32 = b53_srab_read32,