On Sat, 17 Aug 2019 20:03:42 +0200 Marek Behun <marek.be...@nic.cz> wrote:
> One way would be to rename the mv88e6xxx_setup_port function to > mv88e6xxx_setup_port_regs, or mv88e6xxx_port_pre_setup, or something > like that. Would the names mv88e6xxx_port_setup and > mv88e6xxx_setup_port_regs still be very confusing and error prone? > I think maybe yes... > > Other solution would be to, instead of the .port_setup() > and .port_teardown() DSA ops, create the .after_setup() > and .before_teardown() ops I mentioned in the previous mail. > > And yet another (in my opinion very improper) solution could be that > the .setup() method could call dsa_port_setup() from within itself, to > ensure that the needed structres exist. I thought of another solution, one that does not need new DSA operations. What if dsa_port_enable was called for CPU/DSA ports after in dsa_port_setup_switches, after all ports are setup, and dsa_port_disable called for CPU/DSA ports in dsa_port_teardown_switches? This seems to me as cleaner solution. Marek