From 8ad164396c8fac17af4022d924f1050e70e0bd77 Mon Sep 17 00:00:00 2001 From: nsouch Date: Sun, 8 Nov 1998 18:42:34 +0000 Subject: Check if devclass exists for probed devices before declaring the device 'alive'. --- sys/dev/iicbus/iicbus.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/dev/iicbus/iicbus.c') 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; -- cgit v1.1