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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 drivers/i2c/i2c-smbus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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,

-- 
2.45.2





[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux