aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/pccard
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2005-12-28 05:30:09 +0000
committerWarner Losh <imp@FreeBSD.org>2005-12-28 05:30:09 +0000
commitdf2f828a8f5cb7b59f8430e2cb9a8fdc9f2e9b03 (patch)
tree2d1f9c9fccecd5525174a91857f3d5dde4721062 /sys/dev/pccard
parent1bd8f78656fbf528d15790e9e3bca80b1c93e3f7 (diff)
downloadsrc-df2f828a8f5cb7b59f8430e2cb9a8fdc9f2e9b03.tar.gz
src-df2f828a8f5cb7b59f8430e2cb9a8fdc9f2e9b03.zip
Add some sanity checking to the pccard insertion case. Whine if the
bridge tries to tell us about a new card when we have one already in the socket.
Notes
Notes: svn path=/head/; revision=153773
Diffstat (limited to 'sys/dev/pccard')
-rw-r--r--sys/dev/pccard/pccard.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/pccard/pccard.c b/sys/dev/pccard/pccard.c
index 47a150a12d03..aa018930a439 100644
--- a/sys/dev/pccard/pccard.c
+++ b/sys/dev/pccard/pccard.c
@@ -186,10 +186,10 @@ pccard_attach_card(device_t dev)
device_t child;
int i;
- /*
- * this is here so that when socket_enable calls gettype, trt happens
- */
- STAILQ_INIT(&sc->card.pf_head);
+ if (!STAILQ_EMPTY(&sc->card.pf_head)) {
+ if (bootverbose || pccard_debug)
+ device_printf(dev, "Card already inserted.\n");
+ }
DEVPRINTF((dev, "chip_socket_enable\n"));
POWER_ENABLE_SOCKET(device_get_parent(dev), dev);
@@ -325,6 +325,7 @@ pccard_detach_card(device_t dev)
STAILQ_REMOVE_HEAD(&sc->card.pf_head, pf_list);
free(pf, M_DEVBUF);
}
+ STAILQ_INIT(&sc->card.pf_head);
return (0);
}
@@ -778,6 +779,7 @@ pccard_attach(device_t dev)
sc->sc_enabled_count = 0;
if ((err = pccard_device_create(sc)) != 0)
return (err);
+ STAILQ_INIT(&sc->card.pf_head);
return (bus_generic_attach(dev));
}