1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-13 14:40:22 +00:00

Prevent the strange situation that after each load/unload of a ppbus

device, the device is probed multiple times (so each device is
detected N times after unloading/loading the module N-1 times).

The real fix is (quote Doug and Warner):
> : In an ideal world, there should be some kind of BUS_UNIDENTIFY method
> : which a driver could use to delete the devices it created in
> : BUS_IDENTIFY.
>
> Or the bus would have a driver deleted routine that got called and it
> would remove all instances of the devclass attached to it.

Reviewed by:	Doug Rabson & Warner Losh
This commit is contained in:
Guido van Rooij 2004-03-18 21:10:11 +00:00
parent 200c238e95
commit a5c7e3bb70
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=127189
7 changed files with 34 additions and 7 deletions

View File

@ -183,8 +183,11 @@ static devclass_t lp_devclass;
static void
lp_identify(driver_t *driver, device_t parent)
{
device_t dev;
BUS_ADD_CHILD(parent, 0, "plip", -1);
dev = device_find_child(parent, "plip", 0);
if (!dev)
BUS_ADD_CHILD(parent, 0, "plip", -1);
}
/*
* lpprobe()

View File

@ -58,7 +58,11 @@ static void
lpbb_identify(driver_t *driver, device_t parent)
{
BUS_ADD_CHILD(parent, 0, "lpbb", -1);
device_t dev;
dev = device_find_child(parent, "lpbb", 0);
if (!dev)
BUS_ADD_CHILD(parent, 0, "lpbb", -1);
}
static int

View File

@ -340,7 +340,11 @@ static void
lpt_identify(driver_t *driver, device_t parent)
{
BUS_ADD_CHILD(parent, 0, LPT_NAME, -1);
device_t dev;
dev = device_find_child(parent, LPT_NAME, 0);
if (!dev)
BUS_ADD_CHILD(parent, 0, LPT_NAME, -1);
}
/*

View File

@ -117,7 +117,11 @@ static void
pcfclock_identify(driver_t *driver, device_t parent)
{
BUS_ADD_CHILD(parent, 0, PCFCLOCK_NAME, -1);
device_t dev;
dev = device_find_child(parent, PCFCLOCK_NAME, 0);
if (!dev)
BUS_ADD_CHILD(parent, 0, PCFCLOCK_NAME, -1);
}
static int

View File

@ -133,7 +133,11 @@ static void
ppi_identify(driver_t *driver, device_t parent)
{
BUS_ADD_CHILD(parent, 0, "ppi", -1);
device_t dev;
dev = device_find_child(parent, "ppi", 0);
if (!dev)
BUS_ADD_CHILD(parent, 0, "ppi", -1);
}
/*

View File

@ -75,7 +75,11 @@ static void
ppsidentify(driver_t *driver, device_t parent)
{
BUS_ADD_CHILD(parent, 0, PPS_NAME, -1);
device_t dev;
dev = device_find_child(parent, PPS_NAME, 0);
if (!dev)
BUS_ADD_CHILD(parent, 0, PPS_NAME, -1);
}
static int

View File

@ -90,7 +90,11 @@ static void
vpo_identify(driver_t *driver, device_t parent)
{
BUS_ADD_CHILD(parent, 0, "vpo", -1);
device_t dev;
dev = device_find_child(parent, "vpo", 0);
if (!dev)
BUS_ADD_CHILD(parent, 0, "vpo", -1);
}
/*