Subject: kern/36849: Should set bus type in SMBus drivers
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <paul@whooppee.com>
List: netbsd-bugs
Date: 08/27/2007 11:35:00
>Number: 36849
>Category: kern
>Synopsis: Should set bus type in SMBus drivers
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Aug 27 11:35:00 +0000 2007
>Originator: Paul Goyette
>Release: NetBSD 4.99.29
>Organization:
>Environment:
System: NetBSD quicky.whooppee.com 4.99.29 NetBSD 4.99.29 (QUICKY (ASUS A8N5X) 2007-08-17 16:35:29 UTC) #241: Fri Aug 17 09:42:15 PDT 2007 paul@quicky.whooppee.com:/usr/obj/objdir/amd64/sys/arch/amd64/compile/QUICKY amd64
Architecture: x86_64
Machine: amd64
>Description:
ichsmb and nfsmb drivers should both set iba_bus_type to I2C_TYPE_SMBUS
when attaching the bus. This doesn't make much difference in "stock" code,
but is required to implement PR kern/36744, and should be done anyway just
for completeness.
>How-To-Repeat:
>Fix:
Index: ichsmb.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/ichsmb.c,v
retrieving revision 1.7
diff -u -p -r1.7 ichsmb.c
--- ichsmb.c 27 Aug 2007 09:09:22 -0000 1.7
+++ ichsmb.c 27 Aug 2007 11:27:50 -0000
@@ -171,6 +171,7 @@ ichsmb_attach(struct device *parent, str
sc->sc_i2c_tag.ic_exec = ichsmb_i2c_exec;
bzero(&iba, sizeof(iba));
+ iba.iba_type = I2C_TYPE_SMBUS;
iba.iba_tag = &sc->sc_i2c_tag;
config_found(self, &iba, iicbus_print);
Index: nfsmb.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/nfsmb.c,v
retrieving revision 1.4
diff -u -p -r1.4 nfsmb.c
--- nfsmb.c 14 Aug 2007 14:18:17 -0000 1.4
+++ nfsmb.c 27 Aug 2007 11:27:50 -0000
@@ -217,6 +217,7 @@ nfsmb_attach(struct device *parent, stru
return;
}
+ iba.iba_type = I2C_TYPE_SMBUS;
iba.iba_tag = &sc->sc_i2c;
(void) config_found_ia(&sc->sc_dev, "i2cbus", &iba, iicbus_print);
}