Set flags for devices before probing them. In the non-ISA case, flags set

via hints were not getting passed to the child.

PR:		kern/72489
MFC after:	1 day
This commit is contained in:
Nate Lawson 2004-10-13 07:10:41 +00:00
parent 1acd87a81f
commit 6f857c4b9f

View File

@ -2074,7 +2074,7 @@ int
device_set_devclass(device_t dev, const char *classname) device_set_devclass(device_t dev, const char *classname)
{ {
devclass_t dc; devclass_t dc;
int error; int error, flags;
if (!classname) { if (!classname) {
if (dev->devclass) if (dev->devclass)
@ -2093,6 +2093,10 @@ device_set_devclass(device_t dev, const char *classname)
error = devclass_add_device(dc, dev); error = devclass_add_device(dc, dev);
/* Fetch any hints for the device before it is probed. */
if (resource_int_value(classname, dev->unit, "flags", &flags) == 0)
dev->devflags = flags;
bus_data_generation_update(); bus_data_generation_update();
return (error); return (error);
} }