wbsio(4): don't reuse a child that has already been attached
authorConstantine A. Murenin <cnst+dfly@bugmail.mojo.ru>
Mon, 8 Mar 2010 12:34:05 +0000 (07:34 -0500)
committerConstantine A. Murenin <cnst+dfly@bugmail.mojo.ru>
Mon, 8 Mar 2010 12:37:44 +0000 (07:37 -0500)
sys/dev/powermng/wbsio/wbsio.c

index 5b051cb..98ea7c2 100644 (file)
@@ -246,8 +246,10 @@ wbsio_attach(struct device *dev)
                        }
                        break;
                }
-               if (device_is_attached(child))
+               if (device_is_attached(child)) {
+                       child = NULL;
                        continue;
+               }
                device_printf(dev,
                    "found unused %s at 0x%x with state %i, reusing at 0x%x\n",
                    device_get_nameunit(child), isa_get_port(child),