Re: [PATCH v4 5/5] net: dsa: add support for Atheros AR9331 build-in switch

From: Andrew Lunn
Date: Tue Oct 29 2019 - 08:39:08 EST


Hi Oleksij

> > > +static void ar9331_sw_port_disable(struct dsa_switch *ds, int port)
> > > +{
> > > + struct ar9331_sw_priv *priv = (struct ar9331_sw_priv *)ds->priv;
> > > + struct regmap *regmap = priv->regmap;
> > > + int ret;
> > > +
> > > + ret = regmap_write(regmap, AR9331_SW_REG_PORT_STATUS(port), 0);
> > > + if (ret)
> > > + dev_err_ratelimited(priv->dev, "%s: %i\n", __func__, ret);
> > > +}
> >
> > I've asked this before, but i don't remember the answer. Why are
> > port_enable and port_disable the same?
>
> I have only MAC TX/RX enable bit. This bit is set by phylink_mac_link_up and
> removed by phylink_mac_link_down.
> The port enable I use only to set predictable state of the port
> register: all bits cleared. May be i should just drop port enable
> function? What do you think?

At minimum, it needs a comment about why enable and disable are the
same. If i keep asking, others will as well.

If there is nothing useful to do, then drop it.

Andrew