Re: [PATCH net-next v3 5/6] net: dsa: Initialize CPU port ethtool ops per tree

2016-06-07 Thread Andrew Lunn
On Tue, Jun 07, 2016 at 03:13:35PM -0700, Florian Fainelli wrote: > On 06/07/2016 02:51 PM, Andrew Lunn wrote: > >> +int dsa_cpu_port_ethtool_setup(struct dsa_switch_tree *dst, > >> + struct dsa_switch *ds) > >> +{ > >> + struct net_device *master; > >> + struct

Re: [PATCH net-next v3 5/6] net: dsa: Initialize CPU port ethtool ops per tree

2016-06-07 Thread Florian Fainelli
On 06/07/2016 02:51 PM, Andrew Lunn wrote: >> +int dsa_cpu_port_ethtool_setup(struct dsa_switch_tree *dst, >> + struct dsa_switch *ds) >> +{ >> +struct net_device *master; >> +struct ethtool_ops *cpu_ops; >> + >> +master = ds->dst->master_netdev; > > You pass

Re: [PATCH net-next v3 5/6] net: dsa: Initialize CPU port ethtool ops per tree

2016-06-07 Thread Andrew Lunn
> +int dsa_cpu_port_ethtool_setup(struct dsa_switch_tree *dst, > +struct dsa_switch *ds) > +{ > + struct net_device *master; > + struct ethtool_ops *cpu_ops; > + > + master = ds->dst->master_netdev; You pass in dst as a parameter, and then don't use it! >

[PATCH net-next v3 5/6] net: dsa: Initialize CPU port ethtool ops per tree

2016-06-07 Thread Florian Fainelli
Now that we can properly support multiple distinct trees in the system, using a global variable: dsa_cpu_port_ethtool_ops is getting clobbered as soon as the second switch tree gets probed, and we don't want that. We need to move this to be dynamically allocated, and since we can't really be