diff options
| author | Warner Losh <imp@FreeBSD.org> | 2003-02-12 05:57:02 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2003-02-12 05:57:02 +0000 |
| commit | 9476c349dd4fa62258d11309fa008330834b68f1 (patch) | |
| tree | 28e5fe448911572787908451c6c8d9ba67940fe9 /sys/dev | |
| parent | 78b389be8767dad8ccfc086493a68b7ba0fa4852 (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/cardbus/cardbus.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index 01e7700746f7b..48a58fcf617b4 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -313,6 +313,17 @@ cardbus_driver_added(device_t cbdev, driver_t *driver) DEVICE_IDENTIFY(driver, cbdev); device_get_children(cbdev, &devlist, &numdevs); + /* + * If there are no drivers attached, but there are children, + * then power the card up. + */ + for (i = 0; i < numdevs; i++) { + dev = devlist[i]; + if (device_get_state(dev) != DS_NOTPRESENT) + break; + } + if (i > 0 && i == numdevs) + POWER_ENABLE_SOCKET(device_get_parent(cbdev), cbdev); for (i = 0; i < numdevs; i++) { dev = devlist[i]; if (device_get_state(dev) != DS_NOTPRESENT) |
