misc: pch_phub: Make MAC address configuration more robust

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@baylibre.com>
Link: https://patch.msgid.link/796b3667ea49d9156ecc03d1ce9668972316d90b.1779785111.git.u.kleine-koenig@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Uwe Kleine-König (The Capable Hub)
2026-07-17 15:49:01 +02:00
committed by Greg Kroah-Hartman
parent 5fd370856b
commit aefcde780b
+11 -2
View File
@@ -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;