Re: [RFC PATCH 09/16] dsa: dsa: Split up creating/destroying of DSA and CPU ports

2016-05-27 Thread Andrew Lunn
> dsa_cpu_dsa_setups is not really meaningful and doesn't add much > value. I would disagree. Quoting Documentation/CodingStyle Chapter 6: Functions Functions should be short and sweet, and do just one thing. They should fit on one or two screenfuls of text (the ISO/ANSI

Re: [RFC PATCH 09/16] dsa: dsa: Split up creating/destroying of DSA and CPU ports

2016-05-27 Thread Andrew Lunn
On Fri, May 27, 2016 at 03:25:47PM -0400, Vivien Didelot wrote: > Hi Andrew, Florian, > > I suggest to use this RFC to agree on a consistent and robust API for > the DSA layer. Some functions have non-intuitive names or signatures. Nope. What is important is getting this patchset accepted and

Re: [RFC PATCH 09/16] dsa: dsa: Split up creating/destroying of DSA and CPU ports

2016-05-27 Thread Vivien Didelot
Hi Andrew, Florian, I suggest to use this RFC to agree on a consistent and robust API for the DSA layer. Some functions have non-intuitive names or signatures. What about: _[_] where matches the first argument. So instead of dsa_cpu_dsa_setup, we would have:

Re: [RFC PATCH 09/16] dsa: dsa: Split up creating/destroying of DSA and CPU ports

2016-05-27 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: > On Fri, May 27, 2016 at 10:33:49AM -0400, Vivien Didelot wrote: >> Hi Andrew, >> >> Andrew Lunn writes: >> >> > -static void dsa_switch_destroy(struct dsa_switch *ds) >> > +void dsa_cpu_dsa_destroy(struct device_node *port_dn)

Re: [RFC PATCH 09/16] dsa: dsa: Split up creating/destroying of DSA and CPU ports

2016-05-27 Thread Andrew Lunn
On Fri, May 27, 2016 at 10:33:49AM -0400, Vivien Didelot wrote: > Hi Andrew, > > Andrew Lunn writes: > > > -static void dsa_switch_destroy(struct dsa_switch *ds) > > +void dsa_cpu_dsa_destroy(struct device_node *port_dn) > > { > > - struct device_node *port_dn; > > struct

Re: [RFC PATCH 09/16] dsa: dsa: Split up creating/destroying of DSA and CPU ports

2016-05-27 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: > -static void dsa_switch_destroy(struct dsa_switch *ds) > +void dsa_cpu_dsa_destroy(struct device_node *port_dn) > { > - struct device_node *port_dn; > struct phy_device *phydev; > + > + if (of_phy_is_fixed_link(port_dn)) { > +

[RFC PATCH 09/16] dsa: dsa: Split up creating/destroying of DSA and CPU ports

2016-05-26 Thread Andrew Lunn
Refactor the code to setup a single DSA/CPU port into a function of its own, and export it, so it can be used by the new binding. Similarly, refactor the destroy code into a function. Signed-off-by: Andrew Lunn --- net/dsa/dsa.c | 86