From: Florian Fainelli Subject: Re: [PATCH v4 net-next 0/6] net: dsa: microchip: Modify KSZ9477 DSA driver in preparation to add other KSZ switch drivers Date: Tue, 20 Nov 2018 20:15:06 -0800 Message-ID: References: <1542758110-1037-1-git-send-email-Tristram.Ha@microchip.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Andrew Lunn , Pavel Machek , UNGLinuxDriver@microchip.com, netdev@vger.kernel.org To: Tristram.Ha@microchip.com, "David S. Miller" Return-path: Received: from mail-pl1-f196.google.com ([209.85.214.196]:42364 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727542AbeKUOr6 (ORCPT ); Wed, 21 Nov 2018 09:47:58 -0500 Received: by mail-pl1-f196.google.com with SMTP id x21-v6so3490531pln.9 for ; Tue, 20 Nov 2018 20:15:16 -0800 (PST) In-Reply-To: <1542758110-1037-1-git-send-email-Tristram.Ha@microchip.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 11/20/2018 3:55 PM, Tristram.Ha@microchip.com wrote: > From: Tristram Ha > > This series of patches is to modify the original KSZ9477 DSA driver so > that other KSZ switch drivers can be added and use the common code. > > There are several steps to accomplish this achievement. First is to > rename some function names with a prefix to indicate chip specific > function. Second is to move common code into header that can be shared. > Last is to modify tag_ksz.c so that it can handle many tail tag formats > used by different KSZ switch drivers. > > ksz_common.c will contain the common code used by all KSZ switch drivers. > ksz9477.c will contain KSZ9477 code from the original ksz_common.c. > ksz9477_spi.c is renamed from ksz_spi.c. > ksz9477_reg.h is renamed from ksz_9477_reg.h. > ksz_common.h is added to provide common code access to KSZ switch > drivers. > ksz_spi.h is added to provide common SPI access functions to KSZ SPI > drivers. Thanks a lot for getting this series out, hopefully there is no blocker getting it merged now and you can follow-up with additional features. > > v4 > - Patches were removed to concentrate on changing driver structure without > adding new code. > > v3 > - The phy_device structure is used to hold port link information > - A structure is passed in ksz_xmit and ksz_rcv instead of function pointer > - Switch offload forwarding is supported > > v2 > - Initialize reg_mutex before use > - The alu_mutex is only used inside chip specific functions > > v1 > - Each patch in the set is self-contained > - Use ksz9477 prefix to indicate KSZ9477 specific code > > Tristram Ha (6): > net: dsa: microchip: replace license with GPL > net: dsa: microchip: clean up code > net: dsa: microchip: rename some functions with ksz9477 prefix > net: dsa: microchip: rename ksz_spi.c to ksz9477_spi.c > net: dsa: microchip: break KSZ9477 DSA driver into two files > net: dsa: microchip: rename ksz_9477_reg.h to ksz9477_reg.h > > drivers/net/dsa/microchip/Kconfig | 16 +- > drivers/net/dsa/microchip/Makefile | 5 +- > drivers/net/dsa/microchip/ksz9477.c | 1316 ++++++++++++++++++++ > .../microchip/{ksz_9477_reg.h => ksz9477_reg.h} | 17 +- > drivers/net/dsa/microchip/ksz9477_spi.c | 177 +++ > drivers/net/dsa/microchip/ksz_common.c | 1183 +++--------------- > drivers/net/dsa/microchip/ksz_common.h | 214 ++++ > drivers/net/dsa/microchip/ksz_priv.h | 245 ++-- > drivers/net/dsa/microchip/ksz_spi.c | 217 ---- > drivers/net/dsa/microchip/ksz_spi.h | 69 + > 10 files changed, 2039 insertions(+), 1420 deletions(-) > create mode 100644 drivers/net/dsa/microchip/ksz9477.c > rename drivers/net/dsa/microchip/{ksz_9477_reg.h => ksz9477_reg.h} (98%) > create mode 100644 drivers/net/dsa/microchip/ksz9477_spi.c > create mode 100644 drivers/net/dsa/microchip/ksz_common.h > delete mode 100644 drivers/net/dsa/microchip/ksz_spi.c > create mode 100644 drivers/net/dsa/microchip/ksz_spi.h > -- Florian