Skip to contentSkip to conversation

i2c_check_addr is broken in 2.8.0

BUG Applied Sergey Vlasov 2 participants 2 messages May 19, 2005

lore
Share & tools
lore
#0 lore raw

Hello!

In i2c-2.8.0 i2c_check_addr() is broken - it always returns 0, therefore the duplicate address check is not done. i2cdetect does not ever report 'UU', and I have even seen a case when two chips are registered at the same address.

This one-line patch fixes the problem:

kernel/i2c-core.c renamed from kernel/i2c-core.c.check-addr-fix +1 -1
@@ -315,7 +315,7 @@
 	rval = __i2c_check_addr(adapter, addr);
 	up(&adapter->list);
 
-	return 0;
+	return rval;
 }
 
 int i2c_attach_client(struct i2c_client *client)
Signature · 1 line
Sergey Vlasov
#1 lore raw

Hi Sergey:

Applied to CVS, thanks!

In case anyone is wondering (Greg KH) this fix is *not* needed in 2.6 - I checked.

Quoted 14 lines · Sergey Vlasov

Hello!

In i2c-2.8.0 i2c_check_addr() is broken - it always returns 0, therefore the duplicate address check is not done. i2cdetect does not ever report 'UU', and I have even seen a case when two chips are registered at the same address.

This one-line patch fixes the problem:

kernel/i2c-core.c line 321

Quoted 8 lines
kernel/i2c-core.c renamed from kernel/i2c-core.c.check-addr-fix +1 -1
@@ -315,7 +315,7 @@
 	rval = __i2c_check_addr(adapter, addr);
 	up(&adapter->list);
 
-	return 0;
+	return rval;
 }
 
 int i2c_attach_client(struct i2c_client *client)

Regards,

Signature · 2 lines
Mark M. Hoffman
[email protected]