aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa
diff options
context:
space:
mode:
authorJulia Lawall <julia.lawall@lip6.fr>2016-08-09 13:09:45 -0400
committerDavid S. Miller <davem@davemloft.net>2016-08-09 18:09:40 -0400
commit0dff88d39fd0b17a5e3ff03d0264b823cab1352c (patch)
tree03acddfd0ee6da7ca83737f907554a096b9ee162 /drivers/net/dsa
parent631fee7d70e8eabb642b4bcc58f08bbe880c91aa (diff)
net: dsa: b53: constify b53_io_ops structures
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>
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r--drivers/net/dsa/b53/b53_common.c3
-rw-r--r--drivers/net/dsa/b53/b53_mdio.c2
-rw-r--r--drivers/net/dsa/b53/b53_mmap.c2
-rw-r--r--drivers/net/dsa/b53/b53_priv.h3
-rw-r--r--drivers/net/dsa/b53/b53_spi.c2
-rw-r--r--drivers/net/dsa/b53/b53_srab.c2
6 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index bda37d336736..38ee10de7884 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -1681,7 +1681,8 @@ static int b53_switch_init(struct b53_device *dev)
1681 return 0; 1681 return 0;
1682} 1682}
1683 1683
1684struct b53_device *b53_switch_alloc(struct device *base, struct b53_io_ops *ops, 1684struct b53_device *b53_switch_alloc(struct device *base,
1685 const struct b53_io_ops *ops,
1685 void *priv) 1686 void *priv)
1686{ 1687{
1687 struct dsa_switch *ds; 1688 struct dsa_switch *ds;
diff --git a/drivers/net/dsa/b53/b53_mdio.c b/drivers/net/dsa/b53/b53_mdio.c
index aa87c3fffdac..477a16b5660a 100644
--- a/drivers/net/dsa/b53/b53_mdio.c
+++ b/drivers/net/dsa/b53/b53_mdio.c
@@ -267,7 +267,7 @@ static int b53_mdio_phy_write16(struct b53_device *dev, int addr, int reg,
267 return mdiobus_write_nested(bus, addr, reg, value); 267 return mdiobus_write_nested(bus, addr, reg, value);
268} 268}
269 269
270static struct b53_io_ops b53_mdio_ops = { 270static const struct b53_io_ops b53_mdio_ops = {
271 .read8 = b53_mdio_read8, 271 .read8 = b53_mdio_read8,
272 .read16 = b53_mdio_read16, 272 .read16 = b53_mdio_read16,
273 .read32 = b53_mdio_read32, 273 .read32 = b53_mdio_read32,
diff --git a/drivers/net/dsa/b53/b53_mmap.c b/drivers/net/dsa/b53/b53_mmap.c
index 77ffc4312808..cc9e6bd83e0e 100644
--- a/drivers/net/dsa/b53/b53_mmap.c
+++ b/drivers/net/dsa/b53/b53_mmap.c
@@ -208,7 +208,7 @@ static int b53_mmap_write64(struct b53_device *dev, u8 page, u8 reg,
208 return 0; 208 return 0;
209} 209}
210 210
211static struct b53_io_ops b53_mmap_ops = { 211static const struct b53_io_ops b53_mmap_ops = {
212 .read8 = b53_mmap_read8, 212 .read8 = b53_mmap_read8,
213 .read16 = b53_mmap_read16, 213 .read16 = b53_mmap_read16,
214 .read32 = b53_mmap_read32, 214 .read32 = b53_mmap_read32,
diff --git a/drivers/net/dsa/b53/b53_priv.h b/drivers/net/dsa/b53/b53_priv.h
index 835a744f206e..d268493a5fec 100644
--- a/drivers/net/dsa/b53/b53_priv.h
+++ b/drivers/net/dsa/b53/b53_priv.h
@@ -182,7 +182,8 @@ static inline int is_cpu_port(struct b53_device *dev, int port)
182 return dev->cpu_port; 182 return dev->cpu_port;
183} 183}
184 184
185struct b53_device *b53_switch_alloc(struct device *base, struct b53_io_ops *ops, 185struct b53_device *b53_switch_alloc(struct device *base,
186 const struct b53_io_ops *ops,
186 void *priv); 187 void *priv);
187 188
188int b53_switch_detect(struct b53_device *dev); 189int b53_switch_detect(struct b53_device *dev);
diff --git a/drivers/net/dsa/b53/b53_spi.c b/drivers/net/dsa/b53/b53_spi.c
index 2bda0b5f1578..1c847a161bbd 100644
--- a/drivers/net/dsa/b53/b53_spi.c
+++ b/drivers/net/dsa/b53/b53_spi.c
@@ -270,7 +270,7 @@ static int b53_spi_write64(struct b53_device *dev, u8 page, u8 reg, u64 value)
270 return spi_write(spi, txbuf, sizeof(txbuf)); 270 return spi_write(spi, txbuf, sizeof(txbuf));
271} 271}
272 272
273static struct b53_io_ops b53_spi_ops = { 273static const struct b53_io_ops b53_spi_ops = {
274 .read8 = b53_spi_read8, 274 .read8 = b53_spi_read8,
275 .read16 = b53_spi_read16, 275 .read16 = b53_spi_read16,
276 .read32 = b53_spi_read32, 276 .read32 = b53_spi_read32,
diff --git a/drivers/net/dsa/b53/b53_srab.c b/drivers/net/dsa/b53/b53_srab.c
index 3e2d4a5fcd5a..8a62b6a69703 100644
--- a/drivers/net/dsa/b53/b53_srab.c
+++ b/drivers/net/dsa/b53/b53_srab.c
@@ -344,7 +344,7 @@ err:
344 return ret; 344 return ret;
345} 345}
346 346
347static struct b53_io_ops b53_srab_ops = { 347static const struct b53_io_ops b53_srab_ops = {
348 .read8 = b53_srab_read8, 348 .read8 = b53_srab_read8,
349 .read16 = b53_srab_read16, 349 .read16 = b53_srab_read16,
350 .read32 = b53_srab_read32, 350 .read32 = b53_srab_read32,