summaryrefslogtreecommitdiffstats
path: root/net/dsa/dsa.c
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2017-01-08 17:52:08 -0500
committerDavid S. Miller <davem@davemloft.net>2017-01-09 15:44:50 -0500
commita82f67afe8e297834bedafa529941d9d0808caf8 (patch)
tree4e47358cacf8e32212e27b6d78f4d184e2799982 /net/dsa/dsa.c
parentab3d408d3f40f939d46a32b1c24aa2833a13b846 (diff)
net: dsa: Make dsa_switch_ops const
Now that we have properly encapsulated and made drivers utilize exported functions, we can switch dsa_switch_ops to be a annotated with const. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/dsa.c')
-rw-r--r--net/dsa/dsa.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 4e7bc57cdae5..fd532487dfdf 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -76,11 +76,11 @@ void unregister_switch_driver(struct dsa_switch_driver *drv)
76} 76}
77EXPORT_SYMBOL_GPL(unregister_switch_driver); 77EXPORT_SYMBOL_GPL(unregister_switch_driver);
78 78
79static struct dsa_switch_ops * 79static const struct dsa_switch_ops *
80dsa_switch_probe(struct device *parent, struct device *host_dev, int sw_addr, 80dsa_switch_probe(struct device *parent, struct device *host_dev, int sw_addr,
81 const char **_name, void **priv) 81 const char **_name, void **priv)
82{ 82{
83 struct dsa_switch_ops *ret; 83 const struct dsa_switch_ops *ret;
84 struct list_head *list; 84 struct list_head *list;
85 const char *name; 85 const char *name;
86 86
@@ -89,7 +89,7 @@ dsa_switch_probe(struct device *parent, struct device *host_dev, int sw_addr,
89 89
90 mutex_lock(&dsa_switch_drivers_mutex); 90 mutex_lock(&dsa_switch_drivers_mutex);
91 list_for_each(list, &dsa_switch_drivers) { 91 list_for_each(list, &dsa_switch_drivers) {
92 struct dsa_switch_ops *ops; 92 const struct dsa_switch_ops *ops;
93 struct dsa_switch_driver *drv; 93 struct dsa_switch_driver *drv;
94 94
95 drv = list_entry(list, struct dsa_switch_driver, list); 95 drv = list_entry(list, struct dsa_switch_driver, list);
@@ -207,7 +207,7 @@ void dsa_cpu_port_ethtool_restore(struct dsa_switch *ds)
207 207
208static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent) 208static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
209{ 209{
210 struct dsa_switch_ops *ops = ds->ops; 210 const struct dsa_switch_ops *ops = ds->ops;
211 struct dsa_switch_tree *dst = ds->dst; 211 struct dsa_switch_tree *dst = ds->dst;
212 struct dsa_chip_data *cd = ds->cd; 212 struct dsa_chip_data *cd = ds->cd;
213 bool valid_name_found = false; 213 bool valid_name_found = false;
@@ -326,7 +326,7 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index,
326 struct device *parent, struct device *host_dev) 326 struct device *parent, struct device *host_dev)
327{ 327{
328 struct dsa_chip_data *cd = dst->pd->chip + index; 328 struct dsa_chip_data *cd = dst->pd->chip + index;
329 struct dsa_switch_ops *ops; 329 const struct dsa_switch_ops *ops;
330 struct dsa_switch *ds; 330 struct dsa_switch *ds;
331 int ret; 331 int ret;
332 const char *name; 332 const char *name;