Re: [RFC patch net-next 2/3] net: dsa: ksz: remove duplicate ksz_cfg and ksz_port_cfg

From: Vladimir Oltean
Date: Wed Apr 27 2022 - 12:49:51 EST


On Wed, Apr 27, 2022 at 09:53:42PM +0530, Arun Ramadoss wrote:
> ksz8795.c and ksz9477.c has individual ksz_cfg and ksz_port_cfg

Plural (have).

> function, both are same. Hence moving it to ksz_common.c. And removed

Present tense (remove).

> the individual references.
>

Small hint for writing commit messages. You should describe the entire
change, and walk the reviewer through the thought process.

Here, something which you are not mentioning is that the chip-local
implementation for ksz_port_cfg() that ksz8795 and ksz9477 have uses the
PORT_CTRL_ADDR() macro. Whereas the newly added generic ksz_port_cfg()
uses dev->dev_ops->get_port_addr(). The transformation is safe because
both ksz8795 and ksz9477 provide a get_port_addr() implementation.

I didn't know that, so I had to check.