Commit d78d6776 authored by Bhumika Goyal's avatar Bhumika Goyal Committed by David S. Miller

net: dsa: make dsa_switch_ops const

Make these structures const as they are only stored in the ops field of
a dsa_switch structure, which is const.
Done using Coccinelle.
Signed-off-by: default avatarBhumika Goyal <bhumirks@gmail.com>
Reviewed-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 42013e90
...@@ -257,7 +257,7 @@ static int dsa_loop_port_vlan_del(struct dsa_switch *ds, int port, ...@@ -257,7 +257,7 @@ static int dsa_loop_port_vlan_del(struct dsa_switch *ds, int port,
return 0; return 0;
} }
static struct dsa_switch_ops dsa_loop_driver = { static const struct dsa_switch_ops dsa_loop_driver = {
.get_tag_protocol = dsa_loop_get_protocol, .get_tag_protocol = dsa_loop_get_protocol,
.setup = dsa_loop_setup, .setup = dsa_loop_setup,
.get_strings = dsa_loop_get_strings, .get_strings = dsa_loop_get_strings,
......
...@@ -797,7 +797,7 @@ static void lan9303_port_disable(struct dsa_switch *ds, int port, ...@@ -797,7 +797,7 @@ static void lan9303_port_disable(struct dsa_switch *ds, int port,
} }
} }
static struct dsa_switch_ops lan9303_switch_ops = { static const struct dsa_switch_ops lan9303_switch_ops = {
.get_tag_protocol = lan9303_get_tag_protocol, .get_tag_protocol = lan9303_get_tag_protocol,
.setup = lan9303_setup, .setup = lan9303_setup,
.get_strings = lan9303_get_strings, .get_strings = lan9303_get_strings,
......
...@@ -1017,7 +1017,7 @@ mt7530_setup(struct dsa_switch *ds) ...@@ -1017,7 +1017,7 @@ mt7530_setup(struct dsa_switch *ds)
return 0; return 0;
} }
static struct dsa_switch_ops mt7530_switch_ops = { static const struct dsa_switch_ops mt7530_switch_ops = {
.get_tag_protocol = mtk_get_tag_protocol, .get_tag_protocol = mtk_get_tag_protocol,
.setup = mt7530_setup, .setup = mt7530_setup,
.get_strings = mt7530_get_strings, .get_strings = mt7530_get_strings,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment