2017-06-06 19:11 GMT-07:00 Vivien Didelot <vivien.dide...@savoirfairelinux.com>: > Hi Florian, > > Florian Fainelli <f.faine...@gmail.com> writes: > >> +static inline struct dsa_port *dsa_ds_get_cpu_dp(struct dsa_switch *ds) >> +{ >> + return &ds->ports[fls(ds->cpu_port_mask) - 1]; >> +} > > So as I said in v2, now that a driver is guaranteed that dp->cpu_dp is > correctly assigned at setup time, isn't better (especially for future > multi-CPU support) to provide an helper which returns the CPU port for a > given port? i.e. dsa_get_cpu_port(struct dsa_switch *ds, int port). > > Or is there something blocking? I might be wrong.
mt7530.c needs access to the CPU port at ops->setup() time which is why this is still here. > > Note that I'm suggesting s/dsa_ds_get_cpu_dp/dsa_get_cpu_port/ since > public DSA API does not need to use variable shortcuts such as ds or dp, > but that's a minor suggestion? We also have a dsa_dst_get_cpu_dp() but sure dsa_get_cpu_port() works for me. -- Florian