mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 22:51:37 +00:00
net: dsa: Allow the DSA driver to indicate the tag protocol
DSA drivers may drive different families of switches which need different tag protocol. Rather than hard code the tag protocol in the driver structure, have a callback for the DSA core to call. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1ae292a245
commit
7b314362a2
7 changed files with 34 additions and 8 deletions
|
@ -354,7 +354,10 @@ static int dsa_switch_setup_one(struct dsa_switch *ds, struct device *parent)
|
|||
* switch.
|
||||
*/
|
||||
if (dst->cpu_switch == index) {
|
||||
dst->tag_ops = dsa_resolve_tag_protocol(drv->tag_protocol);
|
||||
enum dsa_tag_protocol tag_protocol;
|
||||
|
||||
tag_protocol = drv->get_tag_protocol(ds);
|
||||
dst->tag_ops = dsa_resolve_tag_protocol(tag_protocol);
|
||||
if (IS_ERR(dst->tag_ops)) {
|
||||
ret = PTR_ERR(dst->tag_ops);
|
||||
goto out;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue