diff mbox series

[v2,1/4] i2c: smbus: only limit max banks to eight

Message ID 20240627-piix4-spd-v2-1-617ce47b8ff4@weissschuh.net
State New
Headers show
Series i2c: smbus cleanups and SPD support for piix4 | expand

Commit Message

Thomas Weißschuh June 27, 2024, 5:48 p.m. UTC
If there are less than eight slots in total,
only probe those.
Now the code matches the comment "..., then limit slots to 8".

Fixes: 8821c8376993 ("i2c: smbus: Prepare i2c_register_spd for usage on muxed segments")
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/i2c/i2c-smbus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c
index f809f0ef2004..8f0403652606 100644
--- a/drivers/i2c/i2c-smbus.c
+++ b/drivers/i2c/i2c-smbus.c
@@ -356,7 +356,7 @@  void i2c_register_spd(struct i2c_adapter *adap)
 	 * as this is the max number of SPD EEPROMs that can be addressed per bus.
 	 */
 	if (i2c_parent_is_i2c_adapter(adap)) {
-		slot_count = 8;
+		slot_count = min(slot_count, 8);
 	} else {
 		if (slot_count > 8) {
 			dev_warn(&adap->dev,