[PATCH v1 3/3] misc: pch_phub: Make MAC address configuration more robust

From: Uwe Kleine-König (The Capable Hub)

Date: Tue May 26 2026 - 04:58:12 EST


The comment in pch_phub_write_gbe_mac_addr() suggests that only EG20T,
ML7831 and ML7223 are handled. Replace the code construct using an if
with a switch that has the same semantics but issues a warning if a new
device type is added to the driver without adapting this function.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@xxxxxxxxxxxx>
---
drivers/misc/pch_phub.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/pch_phub.c b/drivers/misc/pch_phub.c
index 5adf7f0c84ab..15785597da40 100644
--- a/drivers/misc/pch_phub.c
+++ b/drivers/misc/pch_phub.c
@@ -324,10 +324,19 @@ static int pch_phub_write_gbe_mac_addr(struct pch_phub_reg *chip, u8 *data)
int retval;
int i;

- if (chip->ioh_type == PCH_EG20T || chip->ioh_type == PCH_ML7831)
+ switch (chip->ioh_type) {
+ case PCH_EG20T:
+ case PCH_ML7831:
retval = pch_phub_gbe_serial_rom_conf(chip);
- else /* ML7223 */
+ break;
+
+ case PCH_ML7213:
+ case PCH_ML7223M:
+ case PCH_ML7223N:
retval = pch_phub_gbe_serial_rom_conf_mp(chip);
+ break;
+ }
+
if (retval)
return retval;

--
2.47.3