diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2017-12-06 18:03:33 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-12-07 14:14:54 -0500 |
commit | 2a93c1a3651fb41b580676c849887b68af6da02b (patch) | |
tree | 15a29c4aa5f0688f75b335e611b1dfd18ee3bb95 /include/net/dsa.h | |
parent | a8168b6cee6e9334dfebb4b9108e8d73794f6088 (diff) |
net: dsa: Allow compiling out legacy support
Introduce a configuration option: CONFIG_NET_DSA_LEGACY allowing to compile out
support for the old platform device and Device Tree binding registration.
Support for these configurations is scheduled to be removed in 4.17.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dsa.h')
-rw-r--r-- | include/net/dsa.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h index d29feccaefab..6cb602dd970c 100644 --- a/include/net/dsa.h +++ b/include/net/dsa.h | |||
@@ -321,12 +321,14 @@ static inline unsigned int dsa_upstream_port(struct dsa_switch *ds, int port) | |||
321 | typedef int dsa_fdb_dump_cb_t(const unsigned char *addr, u16 vid, | 321 | typedef int dsa_fdb_dump_cb_t(const unsigned char *addr, u16 vid, |
322 | bool is_static, void *data); | 322 | bool is_static, void *data); |
323 | struct dsa_switch_ops { | 323 | struct dsa_switch_ops { |
324 | #if IS_ENABLED(CONFIG_NET_DSA_LEGACY) | ||
324 | /* | 325 | /* |
325 | * Legacy probing. | 326 | * Legacy probing. |
326 | */ | 327 | */ |
327 | const char *(*probe)(struct device *dsa_dev, | 328 | const char *(*probe)(struct device *dsa_dev, |
328 | struct device *host_dev, int sw_addr, | 329 | struct device *host_dev, int sw_addr, |
329 | void **priv); | 330 | void **priv); |
331 | #endif | ||
330 | 332 | ||
331 | enum dsa_tag_protocol (*get_tag_protocol)(struct dsa_switch *ds, | 333 | enum dsa_tag_protocol (*get_tag_protocol)(struct dsa_switch *ds, |
332 | int port); | 334 | int port); |
@@ -474,11 +476,20 @@ struct dsa_switch_driver { | |||
474 | const struct dsa_switch_ops *ops; | 476 | const struct dsa_switch_ops *ops; |
475 | }; | 477 | }; |
476 | 478 | ||
479 | #if IS_ENABLED(CONFIG_NET_DSA_LEGACY) | ||
477 | /* Legacy driver registration */ | 480 | /* Legacy driver registration */ |
478 | void register_switch_driver(struct dsa_switch_driver *type); | 481 | void register_switch_driver(struct dsa_switch_driver *type); |
479 | void unregister_switch_driver(struct dsa_switch_driver *type); | 482 | void unregister_switch_driver(struct dsa_switch_driver *type); |
480 | struct mii_bus *dsa_host_dev_to_mii_bus(struct device *dev); | 483 | struct mii_bus *dsa_host_dev_to_mii_bus(struct device *dev); |
481 | 484 | ||
485 | #else | ||
486 | static inline void register_switch_driver(struct dsa_switch_driver *type) { } | ||
487 | static inline void unregister_switch_driver(struct dsa_switch_driver *type) { } | ||
488 | static inline struct mii_bus *dsa_host_dev_to_mii_bus(struct device *dev) | ||
489 | { | ||
490 | return NULL; | ||
491 | } | ||
492 | #endif | ||
482 | struct net_device *dsa_dev_to_net_device(struct device *dev); | 493 | struct net_device *dsa_dev_to_net_device(struct device *dev); |
483 | 494 | ||
484 | /* Keep inline for faster access in hot path */ | 495 | /* Keep inline for faster access in hot path */ |