summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authornsouch <nsouch@FreeBSD.org>1998-11-08 18:42:34 +0000
committernsouch <nsouch@FreeBSD.org>1998-11-08 18:42:34 +0000
commit8ad164396c8fac17af4022d924f1050e70e0bd77 (patch)
tree4bef6062cfde53bc7363a9012af0cbc90a9c3cf8 /sys
parent8576d8f99045b0fdd320203d349d4f044597d8b9 (diff)
downloadFreeBSD-src-8ad164396c8fac17af4022d924f1050e70e0bd77.zip
FreeBSD-src-8ad164396c8fac17af4022d924f1050e70e0bd77.tar.gz
Check if devclass exists for probed devices before
declaring the device 'alive'.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/iicbus/iicbus.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/iicbus/iicbus.c b/sys/dev/iicbus/iicbus.c
index ad57820..b5fe742 100644
--- a/sys/dev/iicbus/iicbus.c
+++ b/sys/dev/iicbus/iicbus.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: iicbus.c,v 1.2 1998/10/31 11:31:07 nsouch Exp $
+ * $Id: iicbus.c,v 1.3 1998/11/07 14:33:46 nsouch Exp $
*
*/
@@ -179,7 +179,9 @@ iicbus_attach(device_t dev)
for (iicdev = iicbus_children; iicdev->iicd_name; iicdev++) {
switch (iicdev->iicd_class) {
case IICBUS_DEVICE_CLASS:
- if (iic_probe_device(dev, iicdev->iicd_addr))
+ /* check if the devclass exists */
+ if (devclass_find(iicdev->iicd_name) &&
+ iic_probe_device(dev, iicdev->iicd_addr))
iicdev->iicd_alive = 1;
break;
OpenPOWER on IntegriCloud