Remove local hacks to set flags now that the device probe does this for us.

Tested on every device except sio_pci and the pc98 fd.c.  Perhaps something
similar should be done for the "disabled" hints also.

MFC after:	2 weeks
This commit is contained in:
Nate Lawson 2004-10-14 22:21:59 +00:00
parent d749cd6f7c
commit e5979322ba
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=136520
10 changed files with 3 additions and 31 deletions

View File

@ -252,8 +252,6 @@ atkbdc_add_child(device_t bus, int order, char *name, int unit)
resource_list_add(&ivar->resources, SYS_RES_IRQ, ivar->rid,
t, t, 1);
if (resource_int_value(name, unit, "flags", &t) == 0)
device_set_flags(child, t);
if (resource_disabled(name, unit))
device_disable(child);

View File

@ -252,8 +252,6 @@ atkbdc_add_child(device_t bus, int order, char *name, int unit)
resource_list_add(&ivar->resources, SYS_RES_IRQ, ivar->rid,
t, t, 1);
if (resource_int_value(name, unit, "flags", &t) == 0)
device_set_flags(child, t);
if (resource_disabled(name, unit))
device_disable(child);

View File

@ -1697,8 +1697,6 @@ fdc_add_child(device_t dev, const char *name, int unit)
device_set_ivars(child, ivar);
ivar->fdunit = unit;
ivar->fdtype = FDT_NONE;
if (resource_int_value(name, unit, "flags", &flags) == 0)
device_set_flags(child, flags);
if (resource_disabled(name, unit))
device_disable(child);
return (child);

View File

@ -96,7 +96,6 @@ sio_pci_attach(dev)
{
u_int32_t type;
struct pci_ids *id;
int flags;
type = pci_get_devid(dev);
id = pci_ids;
@ -105,9 +104,6 @@ sio_pci_attach(dev)
if (id->desc == NULL)
return (ENXIO);
sio_pci_kludge_unit(dev);
if (resource_int_value("sio", device_get_unit(dev), "flags", &flags)
== 0)
device_set_flags(dev, flags);
return (sioattach(dev, id->rid, 0UL));
}

View File

@ -864,7 +864,6 @@ apm_probe(device_t dev)
#define APM_KERNBASE KERNBASE
struct vm86frame vmf;
struct apm_softc *sc = &apm_softc;
int flags;
#ifdef PC98
int rid;
#endif
@ -881,9 +880,6 @@ apm_probe(device_t dev)
return ENXIO;
}
if (resource_int_value("apm", 0, "flags", &flags) != 0)
flags = 0;
bzero(&vmf, sizeof(struct vm86frame)); /* safety */
bzero(&apm_softc, sizeof(apm_softc));
vmf.vmf_ah = APM_BIOS;
@ -1123,16 +1119,12 @@ static int
apm_attach(device_t dev)
{
struct apm_softc *sc = &apm_softc;
int flags;
int drv_version;
#ifdef PC98
int rid;
#endif
if (resource_int_value("apm", 0, "flags", &flags) != 0)
flags = 0;
if (flags & 0x20)
if (device_get_flags(dev) & 0x20)
statclock_disable = 1;
sc->initialized = 0;

View File

@ -421,8 +421,7 @@ npx_attach(dev)
int flags;
register_t s;
if (resource_int_value("npx", 0, "flags", &flags) != 0)
flags = 0;
flags = device_get_flags(dev);
if (flags)
device_printf(dev, "flags 0x%x ", flags);

View File

@ -252,8 +252,6 @@ atkbdc_add_child(device_t bus, int order, char *name, int unit)
resource_list_add(&ivar->resources, SYS_RES_IRQ, ivar->rid,
t, t, 1);
if (resource_int_value(name, unit, "flags", &t) == 0)
device_set_flags(child, t);
if (resource_disabled(name, unit))
device_disable(child);

View File

@ -39,7 +39,7 @@ static void
isahint_add_device(device_t parent, const char *name, int unit)
{
device_t child;
int sensitive, start, count, t;
int sensitive, start, count;
int order;
/* device-specific flag overrides any wildcard */
@ -76,9 +76,6 @@ isahint_add_device(device_t parent, const char *name, int unit)
if (resource_int_value(name, unit, "drq", &start) == 0 && start >= 0)
bus_set_resource(child, SYS_RES_DRQ, 0, start, 1);
if (resource_int_value(name, unit, "flags", &t) == 0)
device_set_flags(child, t);
if (resource_disabled(name, unit))
device_disable(child);
}

View File

@ -914,8 +914,6 @@ fdc_add_child(device_t dev, const char *name, int unit)
device_set_ivars(child, ivar);
ivar->fdunit = unit;
ivar->fdtype = FDT_NONE;
if (resource_int_value(name, unit, "flags", &flags) == 0)
device_set_flags(child, flags);
if (resource_disabled(name, unit))
device_disable(child);
return (child);

View File

@ -914,8 +914,6 @@ fdc_add_child(device_t dev, const char *name, int unit)
device_set_ivars(child, ivar);
ivar->fdunit = unit;
ivar->fdtype = FDT_NONE;
if (resource_int_value(name, unit, "flags", &flags) == 0)
device_set_flags(child, flags);
if (resource_disabled(name, unit))
device_disable(child);
return (child);