diff mbox series

[net-next,v2,1/3] net: dsa: microchip: rename ksz8 series files

Message ID 20240830141250.30425-2-vtpieter@gmail.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: dsa: microchip: rename and clean ksz8 series files | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 16 this patch: 16
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 9 of 9 maintainers
netdev/build_clang success Errors and warnings before: 17 this patch: 17
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 22 this patch: 22
netdev/checkpatch warning WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc fail Errors and warnings before: 0 this patch: 1
netdev/source_inline success Was 0 now: 0

Commit Message

Pieter Aug. 30, 2024, 2:12 p.m. UTC
From: Pieter Van Trappen <pieter.van.trappen@cern.ch>

The first KSZ8 series implementation was done for a KSZ8795 device but
since several other KSZ8 devices have been added. Rename these files
to adhere to the ksz8 naming convention as already used in most
functions and the existing ksz8.h; add an explanatory note.

Signed-off-by: Pieter Van Trappen <pieter.van.trappen@cern.ch>
---
 drivers/net/dsa/microchip/Kconfig                     |  9 ++++++---
 drivers/net/dsa/microchip/Makefile                    |  2 +-
 drivers/net/dsa/microchip/{ksz8795.c => ksz8.c}       | 11 +++++++++--
 .../net/dsa/microchip/{ksz8795_reg.h => ksz8_reg.h}   | 11 ++++++++---
 4 files changed, 24 insertions(+), 9 deletions(-)
 rename drivers/net/dsa/microchip/{ksz8795.c => ksz8.c} (99%)
 rename drivers/net/dsa/microchip/{ksz8795_reg.h => ksz8_reg.h} (98%)

Comments

Arun Ramadoss Sept. 2, 2024, 2:56 a.m. UTC | #1
Hi Pieter, 

On Fri, 2024-08-30 at 16:12 +0200, vtpieter@gmail.com wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
> 
> From: Pieter Van Trappen <pieter.van.trappen@cern.ch>
> 
> 
> 
> diff --git a/drivers/net/dsa/microchip/Kconfig
> b/drivers/net/dsa/microchip/Kconfig
> index c1b906c05a02..d43535c9aa72 100644
> --- a/drivers/net/dsa/microchip/Kconfig
> +++ b/drivers/net/dsa/microchip/Kconfig
> @@ -1,14 +1,17 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  menuconfig NET_DSA_MICROCHIP_KSZ_COMMON
> -       tristate "Microchip KSZ8795/KSZ9477/LAN937x series switch
> support"
> +       tristate "Microchip KSZ8XXX/KSZ9477/LAN937X series switch
> support"
>         depends on NET_DSA
>         select NET_DSA_TAG_KSZ
>         select NET_DSA_TAG_NONE
>         select NET_IEEE8021Q_HELPERS
>         select DCB
>         help
> -         This driver adds support for Microchip KSZ9477 series
> switch and
> -         KSZ8795/KSZ88x3 switch chips.
> +         This driver adds support for Microchip KSZ9477 series,
> +         LAN937X series and KSZ8 series switch chips, being
> +         KSZ9477/9896/9897/9893/9563/9567,

You missed KSZ8567 and KSZ8563. Also it could be in order as suggested
by Tristram,
-  KSZ8863/8873, KSZ8895/8864, KSZ8794/8795/8765
-  KSZ9477/9897/9896/9567/8567
-  KSZ9893/9563/8563
-  LAN9370/9371/9372/9373/9374

> +         LAN9370/9371/9372/9373/9374, KSZ8863/8873, KSZ8895/8864 and
> +         KSZ8794/8795/8765.
> 
> 
> @@ -1,6 +1,13 @@
>  // SPDX-License-Identifier: GPL-2.0
>  /*
> - * Microchip KSZ8795 switch driver
> + * Microchip KSZ8XXX series switch driver
> + *
> + * It supports the following switches:
> + * - KSZ8863, KSZ8873 aka KSZ88X3
> + * - KSZ8895, KSZ8864 aka KSZ8895 family

You can remove 'family' here, so as to be consistent. 

> + * - KSZ8794, KSZ8795, KSZ8765 aka KSZ87XX
> + * Note that it does NOT support:
> + * - KSZ8563, KSZ8567 - see KSZ9477 driver
>   *
>   * Copyright (C) 2017 Microchip Technology Inc.
>   *     Tristram Ha <Tristram.Ha@microchip.com>
> @@ -23,7 +30,7 @@
>  #include <linux/phylink.h>
>
Pieter Sept. 2, 2024, 10:08 a.m. UTC | #2
Hi Arun,

> > -         This driver adds support for Microchip KSZ9477 series
> > switch and
> > -         KSZ8795/KSZ88x3 switch chips.
> > +         This driver adds support for Microchip KSZ9477 series,
> > +         LAN937X series and KSZ8 series switch chips, being
> > +         KSZ9477/9896/9897/9893/9563/9567,
>
> You missed KSZ8567 and KSZ8563. Also it could be in order as suggested
> by Tristram,
> -  KSZ8863/8873, KSZ8895/8864, KSZ8794/8795/8765
> -  KSZ9477/9897/9896/9567/8567
> -  KSZ9893/9563/8563
> -  LAN9370/9371/9372/9373/9374

OK will do.

> > + * It supports the following switches:
> > + * - KSZ8863, KSZ8873 aka KSZ88X3
> > + * - KSZ8895, KSZ8864 aka KSZ8895 family
>
> You can remove 'family' here, so as to be consistent.

Well I'd rather keep it so it's consistent with the ksz_common.h
ksz_is_8895_family(), do you agree?

> > + * - KSZ8794, KSZ8795, KSZ8765 aka KSZ87XX
> > + * Note that it does NOT support:
> > + * - KSZ8563, KSZ8567 - see KSZ9477 driver
> >   *
> >   * Copyright (C) 2017 Microchip Technology Inc.
> >   *     Tristram Ha <Tristram.Ha@microchip.com>
> > @@ -23,7 +30,7 @@
> >  #include <linux/phylink.h>
> >

Cheers, Pieter
Arun Ramadoss Sept. 2, 2024, 2:30 p.m. UTC | #3
Hi Pieter,

On Mon, 2024-09-02 at 12:08 +0200, Pieter wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
> 
> Hi Arun,
> 
> > > -         This driver adds support for Microchip KSZ9477 series
> > > switch and
> > > -         KSZ8795/KSZ88x3 switch chips.
> > > +         This driver adds support for Microchip KSZ9477 series,
> > > +         LAN937X series and KSZ8 series switch chips, being
> > > +         KSZ9477/9896/9897/9893/9563/9567,
> > 
> > You missed KSZ8567 and KSZ8563. Also it could be in order as
> > suggested
> > by Tristram,
> > -  KSZ8863/8873, KSZ8895/8864, KSZ8794/8795/8765
> > -  KSZ9477/9897/9896/9567/8567
> > -  KSZ9893/9563/8563
> > -  LAN9370/9371/9372/9373/9374
> 
> OK will do.
> 
> > > + * It supports the following switches:
> > > + * - KSZ8863, KSZ8873 aka KSZ88X3
> > > + * - KSZ8895, KSZ8864 aka KSZ8895 family
> > 
> > You can remove 'family' here, so as to be consistent.
> 
> Well I'd rather keep it so it's consistent with the ksz_common.h
> ksz_is_8895_family(), do you agree?

OK. LGTM.
diff mbox series

Patch

diff --git a/drivers/net/dsa/microchip/Kconfig b/drivers/net/dsa/microchip/Kconfig
index c1b906c05a02..d43535c9aa72 100644
--- a/drivers/net/dsa/microchip/Kconfig
+++ b/drivers/net/dsa/microchip/Kconfig
@@ -1,14 +1,17 @@ 
 # SPDX-License-Identifier: GPL-2.0-only
 menuconfig NET_DSA_MICROCHIP_KSZ_COMMON
-	tristate "Microchip KSZ8795/KSZ9477/LAN937x series switch support"
+	tristate "Microchip KSZ8XXX/KSZ9477/LAN937X series switch support"
 	depends on NET_DSA
 	select NET_DSA_TAG_KSZ
 	select NET_DSA_TAG_NONE
 	select NET_IEEE8021Q_HELPERS
 	select DCB
 	help
-	  This driver adds support for Microchip KSZ9477 series switch and
-	  KSZ8795/KSZ88x3 switch chips.
+	  This driver adds support for Microchip KSZ9477 series,
+	  LAN937X series and KSZ8 series switch chips, being
+	  KSZ9477/9896/9897/9893/9563/9567,
+	  LAN9370/9371/9372/9373/9374, KSZ8863/8873, KSZ8895/8864 and
+	  KSZ8794/8795/8765.
 
 config NET_DSA_MICROCHIP_KSZ9477_I2C
 	tristate "KSZ series I2C connected switch driver"
diff --git a/drivers/net/dsa/microchip/Makefile b/drivers/net/dsa/microchip/Makefile
index 1cfba1ec9355..9347cfb3d0b5 100644
--- a/drivers/net/dsa/microchip/Makefile
+++ b/drivers/net/dsa/microchip/Makefile
@@ -2,7 +2,7 @@ 
 obj-$(CONFIG_NET_DSA_MICROCHIP_KSZ_COMMON)	+= ksz_switch.o
 ksz_switch-objs := ksz_common.o ksz_dcb.o
 ksz_switch-objs += ksz9477.o ksz9477_acl.o ksz9477_tc_flower.o
-ksz_switch-objs += ksz8795.o
+ksz_switch-objs += ksz8.o
 ksz_switch-objs += lan937x_main.o
 
 ifdef CONFIG_NET_DSA_MICROCHIP_KSZ_PTP
diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8.c
similarity index 99%
rename from drivers/net/dsa/microchip/ksz8795.c
rename to drivers/net/dsa/microchip/ksz8.c
index aa09d89debf0..7af3c0853505 100644
--- a/drivers/net/dsa/microchip/ksz8795.c
+++ b/drivers/net/dsa/microchip/ksz8.c
@@ -1,6 +1,13 @@ 
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Microchip KSZ8795 switch driver
+ * Microchip KSZ8XXX series switch driver
+ *
+ * It supports the following switches:
+ * - KSZ8863, KSZ8873 aka KSZ88X3
+ * - KSZ8895, KSZ8864 aka KSZ8895 family
+ * - KSZ8794, KSZ8795, KSZ8765 aka KSZ87XX
+ * Note that it does NOT support:
+ * - KSZ8563, KSZ8567 - see KSZ9477 driver
  *
  * Copyright (C) 2017 Microchip Technology Inc.
  *	Tristram Ha <Tristram.Ha@microchip.com>
@@ -23,7 +30,7 @@ 
 #include <linux/phylink.h>
 
 #include "ksz_common.h"
-#include "ksz8795_reg.h"
+#include "ksz8_reg.h"
 #include "ksz8.h"
 
 static void ksz_cfg(struct ksz_device *dev, u32 addr, u8 bits, bool set)
diff --git a/drivers/net/dsa/microchip/ksz8795_reg.h b/drivers/net/dsa/microchip/ksz8_reg.h
similarity index 98%
rename from drivers/net/dsa/microchip/ksz8795_reg.h
rename to drivers/net/dsa/microchip/ksz8_reg.h
index 69566a5d9cda..ff264d57594f 100644
--- a/drivers/net/dsa/microchip/ksz8795_reg.h
+++ b/drivers/net/dsa/microchip/ksz8_reg.h
@@ -1,13 +1,18 @@ 
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 /*
- * Microchip KSZ8795 register definitions
+ * Microchip KSZ8XXX series register definitions
+ *
+ * The base for these definitions is KSZ8795 but unless indicated
+ * differently by their prefix, they apply to all KSZ8 series
+ * devices. Registers and masks that do change are defined in
+ * dedicated structures in ksz_common.c.
  *
  * Copyright (c) 2017 Microchip Technology Inc.
  *	Tristram Ha <Tristram.Ha@microchip.com>
  */
 
-#ifndef __KSZ8795_REG_H
-#define __KSZ8795_REG_H
+#ifndef __KSZ8_REG_H
+#define __KSZ8_REG_H
 
 #define KS_PORT_M			0x1F