summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-01-09 15:44:57 -0500
committerDavid S. Miller <davem@davemloft.net>2017-01-09 15:44:57 -0500
commit73517885fc1afcecca804ef9a839e2b6fca7387c (patch)
tree4e47358cacf8e32212e27b6d78f4d184e2799982 /include
parent1940075b5c2fbc83b8d39e75587cb0ad2d297415 (diff)
parenta82f67afe8e297834bedafa529941d9d0808caf8 (diff)
Merge branch 'dsa_swqitch_ops-const'
Florian Fainelli says: ==================== net: dsa: Make dsa_switch_ops const This patch series allows us to annotate dsa_switch_ops with a const qualifier. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/dsa.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index b122196d5a1f..b94d1f2ef912 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -169,7 +169,7 @@ struct dsa_switch {
/*
* The switch operations.
*/
- struct dsa_switch_ops *ops;
+ const struct dsa_switch_ops *ops;
/*
* An array of which element [a] indicates which port on this
@@ -240,8 +240,6 @@ struct switchdev_obj_port_mdb;
struct switchdev_obj_port_vlan;
struct dsa_switch_ops {
- struct list_head list;
-
/*
* Probing and setup.
*/
@@ -390,8 +388,13 @@ struct dsa_switch_ops {
int (*cb)(struct switchdev_obj *obj));
};
-void register_switch_driver(struct dsa_switch_ops *type);
-void unregister_switch_driver(struct dsa_switch_ops *type);
+struct dsa_switch_driver {
+ struct list_head list;
+ const struct dsa_switch_ops *ops;
+};
+
+void register_switch_driver(struct dsa_switch_driver *type);
+void unregister_switch_driver(struct dsa_switch_driver *type);
struct mii_bus *dsa_host_dev_to_mii_bus(struct device *dev);
static inline bool dsa_uses_tagged_protocol(struct dsa_switch_tree *dst)