Add device_identify methods so that we do not need the

hint.sc.0.at=isa and hint.vga.0.at=isa  hints in order for these to
probe/attach.
This commit is contained in:
Peter Wemm 2000-06-28 22:53:35 +00:00
parent 61e9944f4f
commit c20ac811f3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=62225
2 changed files with 43 additions and 36 deletions

View file

@ -62,25 +62,14 @@
static devclass_t sc_devclass;
static int scprobe(device_t dev);
static int scattach(device_t dev);
static int scresume(device_t dev);
static device_method_t sc_methods[] = {
DEVMETHOD(device_probe, scprobe),
DEVMETHOD(device_attach, scattach),
DEVMETHOD(device_resume, scresume),
{ 0, 0 }
};
static driver_t sc_driver = {
SC_DRIVER_NAME,
sc_methods,
sizeof(sc_softc_t),
};
static sc_softc_t main_softc;
static void
scidentify (driver_t *driver, device_t parent)
{
BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "sc", 0);
}
static int
scprobe(device_t dev)
{
@ -242,4 +231,18 @@ sc_tone(int herz)
return 0;
}
static device_method_t sc_methods[] = {
DEVMETHOD(device_identify, scidentify),
DEVMETHOD(device_probe, scprobe),
DEVMETHOD(device_attach, scattach),
DEVMETHOD(device_resume, scresume),
{ 0, 0 }
};
static driver_t sc_driver = {
SC_DRIVER_NAME,
sc_methods,
sizeof(sc_softc_t),
};
DRIVER_MODULE(sc, isa, sc_driver, sc_devclass, 0, 0);

View file

@ -59,25 +59,6 @@
static devclass_t isavga_devclass;
static int isavga_probe(device_t dev);
static int isavga_attach(device_t dev);
static device_method_t isavga_methods[] = {
DEVMETHOD(device_probe, isavga_probe),
DEVMETHOD(device_attach, isavga_attach),
DEVMETHOD(bus_print_child, bus_generic_print_child),
{ 0, 0 }
};
static driver_t isavga_driver = {
VGA_DRIVER_NAME,
isavga_methods,
sizeof(vga_softc_t),
};
DRIVER_MODULE(vga, isa, isavga_driver, isavga_devclass, 0, 0);
#ifdef FB_INSTALL_CDEV
static d_open_t isavga_open;
@ -106,6 +87,12 @@ static struct cdevsw isavga_cdevsw = {
#endif /* FB_INSTALL_CDEV */
static void
isavga_identify(driver_t *driver, device_t parent)
{
BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, VGA_DRIVER_NAME, 0);
}
static int
isavga_probe(device_t dev)
{
@ -216,3 +203,20 @@ isavga_mmap(dev_t dev, vm_offset_t offset, int prot)
}
#endif /* FB_INSTALL_CDEV */
static device_method_t isavga_methods[] = {
DEVMETHOD(device_identify, isavga_identify),
DEVMETHOD(device_probe, isavga_probe),
DEVMETHOD(device_attach, isavga_attach),
DEVMETHOD(bus_print_child, bus_generic_print_child),
{ 0, 0 }
};
static driver_t isavga_driver = {
VGA_DRIVER_NAME,
isavga_methods,
sizeof(vga_softc_t),
};
DRIVER_MODULE(vga, isa, isavga_driver, isavga_devclass, 0, 0);