Skip to contentSkip to conversation

hwmon: (asus-ec-sensors) fix looping over banks while reading from EC

PATCH Applied Eugene Shalygin 3 participants 3 messages Jul 11 – Jul 19

Subsystems (2)
lore
Share & tools
lore

Eugene Shalygin

author maintainer
#0 lore raw

PATCH 1/1 hwmon: (asus-ec-sensors) fix looping over banks while reading from EC

Do not assume there are only bank 0 and bank 1 available, just use '!=' for bank comparison.

Fixes d0ddfd241e57 ("hwmon: (asus-ec-sensors) add driver for ASUS EC")
---
 drivers/hwmon/asus-ec-sensors.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/asus-ec-sensors.c +1 -1
index 29a23484cbe7..4de6045d1b68 100644
@@ -1189,7 +1189,7 @@ static int asus_ec_block_read(const struct device *dev,
 		}
 		for (ireg = 0; ireg < ec->nr_registers; ireg++) {
 			reg_bank = register_bank(ec->registers[ireg]);
-			if (reg_bank < bank) {
+			if (reg_bank != bank) {
 				continue;
 			}
 			ec_read(register_index(ec->registers[ireg]),
Signature · 1 line
2.55.0
#1 lore raw
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 5 lines

Do not assume there are only bank 0 and bank 1 available, just use '!=' for bank comparison.

Fixes d0ddfd241e57 ("hwmon: (asus-ec-sensors) add driver for ASUS EC")

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1