diff options
author | peter <peter@FreeBSD.org> | 1999-09-03 11:32:21 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-09-03 11:32:21 +0000 |
commit | afe8351c908d1ac395ec057a78518bb36db07da4 (patch) | |
tree | 20be182c4b2f43369410a9d240c55e88d07bd3ab | |
parent | 8258db9b9202a1cadabb689d27328ef31bb00abc (diff) | |
download | FreeBSD-src-afe8351c908d1ac395ec057a78518bb36db07da4.zip FreeBSD-src-afe8351c908d1ac395ec057a78518bb36db07da4.tar.gz |
Cosmetic tweak. Collect the fdc methods together and apart from the fd
methods so it's a little easier to seperate the two when reading the code.
-rw-r--r-- | sys/dev/fdc/fdc.c | 97 | ||||
-rw-r--r-- | sys/isa/fd.c | 97 |
2 files changed, 106 insertions, 88 deletions
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index 7704cca..1097933 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -568,6 +568,9 @@ fd_read_status(fdc_p fdc, int fdsu) /* autoconfiguration stuff */ /****************************************************************************/ +/* + * fdc controller section. + */ static int fdc_probe(device_t dev) { @@ -760,6 +763,34 @@ fdc_print_child(device_t me, device_t child) return (retval); } +static device_method_t fdc_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, fdc_probe), + DEVMETHOD(device_attach, fdc_attach), + DEVMETHOD(device_detach, bus_generic_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + + /* Bus interface */ + DEVMETHOD(bus_print_child, fdc_print_child), + /* Our children never use any other bus interface methods. */ + + { 0, 0 } +}; + +static driver_t fdc_driver = { + "fdc", + fdc_methods, + sizeof(struct fdc_data) +}; + +DRIVER_MODULE(fdc, isa, fdc_driver, fdc_devclass, 0, 0); + +/******************************************************************/ +/* + * devices attached to the controller section. + */ static int fd_probe(device_t dev) { @@ -932,6 +963,28 @@ fd_attach(device_t dev) return (0); } +static device_method_t fd_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, fd_probe), + DEVMETHOD(device_attach, fd_attach), + DEVMETHOD(device_detach, bus_generic_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), /* XXX */ + DEVMETHOD(device_resume, bus_generic_resume), /* XXX */ + + { 0, 0 } +}; + +static driver_t fd_driver = { + "fd", + fd_methods, + sizeof(struct fd_data) +}; + +DEV_DRIVER_MODULE(fd, fdc, fd_driver, fd_devclass, fd_cdevsw, 0, 0); + +/******************************************************************/ + #ifdef FDC_YE /* * this is a subset of fdattach() optimized for the Y-E Data @@ -2244,50 +2297,6 @@ fdioctl(dev, cmd, addr, flag, p) return (error); } -static device_method_t fdc_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, fdc_probe), - DEVMETHOD(device_attach, fdc_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - - /* Bus interface */ - DEVMETHOD(bus_print_child, fdc_print_child), - /* Our children never use any other bus interface methods. */ - - { 0, 0 } -}; - -static driver_t fdc_driver = { - "fdc", - fdc_methods, - sizeof(struct fdc_data) -}; - -DRIVER_MODULE(fdc, isa, fdc_driver, fdc_devclass, 0, 0); - -static device_method_t fd_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, fd_probe), - DEVMETHOD(device_attach, fd_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), /* XXX */ - DEVMETHOD(device_resume, bus_generic_resume), /* XXX */ - - { 0, 0 } -}; - -static driver_t fd_driver = { - "fd", - fd_methods, - sizeof(struct fd_data) -}; - -DEV_DRIVER_MODULE(fd, fdc, fd_driver, fd_devclass, fd_cdevsw, 0, 0); - #endif /* NFDC > 0 */ /* diff --git a/sys/isa/fd.c b/sys/isa/fd.c index 7704cca..1097933 100644 --- a/sys/isa/fd.c +++ b/sys/isa/fd.c @@ -568,6 +568,9 @@ fd_read_status(fdc_p fdc, int fdsu) /* autoconfiguration stuff */ /****************************************************************************/ +/* + * fdc controller section. + */ static int fdc_probe(device_t dev) { @@ -760,6 +763,34 @@ fdc_print_child(device_t me, device_t child) return (retval); } +static device_method_t fdc_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, fdc_probe), + DEVMETHOD(device_attach, fdc_attach), + DEVMETHOD(device_detach, bus_generic_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + + /* Bus interface */ + DEVMETHOD(bus_print_child, fdc_print_child), + /* Our children never use any other bus interface methods. */ + + { 0, 0 } +}; + +static driver_t fdc_driver = { + "fdc", + fdc_methods, + sizeof(struct fdc_data) +}; + +DRIVER_MODULE(fdc, isa, fdc_driver, fdc_devclass, 0, 0); + +/******************************************************************/ +/* + * devices attached to the controller section. + */ static int fd_probe(device_t dev) { @@ -932,6 +963,28 @@ fd_attach(device_t dev) return (0); } +static device_method_t fd_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, fd_probe), + DEVMETHOD(device_attach, fd_attach), + DEVMETHOD(device_detach, bus_generic_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), /* XXX */ + DEVMETHOD(device_resume, bus_generic_resume), /* XXX */ + + { 0, 0 } +}; + +static driver_t fd_driver = { + "fd", + fd_methods, + sizeof(struct fd_data) +}; + +DEV_DRIVER_MODULE(fd, fdc, fd_driver, fd_devclass, fd_cdevsw, 0, 0); + +/******************************************************************/ + #ifdef FDC_YE /* * this is a subset of fdattach() optimized for the Y-E Data @@ -2244,50 +2297,6 @@ fdioctl(dev, cmd, addr, flag, p) return (error); } -static device_method_t fdc_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, fdc_probe), - DEVMETHOD(device_attach, fdc_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - - /* Bus interface */ - DEVMETHOD(bus_print_child, fdc_print_child), - /* Our children never use any other bus interface methods. */ - - { 0, 0 } -}; - -static driver_t fdc_driver = { - "fdc", - fdc_methods, - sizeof(struct fdc_data) -}; - -DRIVER_MODULE(fdc, isa, fdc_driver, fdc_devclass, 0, 0); - -static device_method_t fd_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, fd_probe), - DEVMETHOD(device_attach, fd_attach), - DEVMETHOD(device_detach, bus_generic_detach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), /* XXX */ - DEVMETHOD(device_resume, bus_generic_resume), /* XXX */ - - { 0, 0 } -}; - -static driver_t fd_driver = { - "fd", - fd_methods, - sizeof(struct fd_data) -}; - -DEV_DRIVER_MODULE(fd, fdc, fd_driver, fd_devclass, fd_cdevsw, 0, 0); - #endif /* NFDC > 0 */ /* |