diff --git a/sys/powerpc/amigaone/cpld_a1222.c b/sys/powerpc/amigaone/cpld_a1222.c --- a/sys/powerpc/amigaone/cpld_a1222.c +++ b/sys/powerpc/amigaone/cpld_a1222.c @@ -118,11 +118,7 @@ DEVMETHOD_END }; -static driver_t cpld_driver = { - "cpld", - cpld_methods, - sizeof(struct cpld_softc) -}; +DEFINE_CLASS_0(cpld, cpld_driver, cpld_methods, sizeof(struct cpld_softc)); DRIVER_MODULE(cpld, lbc, cpld_driver, 0, 0); diff --git a/sys/powerpc/amigaone/cpld_x5000.c b/sys/powerpc/amigaone/cpld_x5000.c --- a/sys/powerpc/amigaone/cpld_x5000.c +++ b/sys/powerpc/amigaone/cpld_x5000.c @@ -105,11 +105,7 @@ DEVMETHOD_END }; -static driver_t cpld_driver = { - "cpld", - cpld_methods, - sizeof(struct cpld_softc) -}; +DEFINE_CLASS_0(cpld, cpld_driver, cpld_methods, sizeof(struct cpld_softc)); DRIVER_MODULE(cpld, lbc, cpld_driver, 0, 0); diff --git a/sys/powerpc/cpufreq/dfs.c b/sys/powerpc/cpufreq/dfs.c --- a/sys/powerpc/cpufreq/dfs.c +++ b/sys/powerpc/cpufreq/dfs.c @@ -59,15 +59,12 @@ DEVMETHOD(cpufreq_drv_get, dfs_get), DEVMETHOD(cpufreq_drv_type, dfs_type), DEVMETHOD(cpufreq_drv_settings, dfs_settings), - {0, 0} -}; -static driver_t dfs_driver = { - "dfs", - dfs_methods, - sizeof(struct dfs_softc) + DEVMETHOD_END }; +DEFINE_CLASS_0(dfs, dfs_driver, dfs_methods, sizeof(struct dfs_softc)); + DRIVER_MODULE(dfs, cpu, dfs_driver, 0, 0); /* diff --git a/sys/powerpc/cpufreq/mpc85xx_jog.c b/sys/powerpc/cpufreq/mpc85xx_jog.c --- a/sys/powerpc/cpufreq/mpc85xx_jog.c +++ b/sys/powerpc/cpufreq/mpc85xx_jog.c @@ -85,15 +85,13 @@ DEVMETHOD(cpufreq_drv_get, mpc85xx_jog_get), DEVMETHOD(cpufreq_drv_type, mpc85xx_jog_type), DEVMETHOD(cpufreq_drv_settings, mpc85xx_jog_settings), - {0, 0} -}; -static driver_t mpc85xx_jog_driver = { - "jog", - mpc85xx_jog_methods, - sizeof(struct mpc85xx_jog_softc) + DEVMETHOD_END }; +DEFINE_CLASS_0(jog, mpc85xx_jog_driver, mpc85xx_jog_methods, + sizeof(struct mpc85xx_jog_softc)); + DRIVER_MODULE(mpc85xx_jog, cpu, mpc85xx_jog_driver, 0, 0); struct mpc85xx_constraints { diff --git a/sys/powerpc/cpufreq/pcr.c b/sys/powerpc/cpufreq/pcr.c --- a/sys/powerpc/cpufreq/pcr.c +++ b/sys/powerpc/cpufreq/pcr.c @@ -62,15 +62,12 @@ DEVMETHOD(cpufreq_drv_get, pcr_get), DEVMETHOD(cpufreq_drv_type, pcr_type), DEVMETHOD(cpufreq_drv_settings, pcr_settings), - {0, 0} -}; -static driver_t pcr_driver = { - "pcr", - pcr_methods, - sizeof(struct pcr_softc) + DEVMETHOD_END }; +DEFINE_CLASS_0(pcr, pcr_driver, pcr_methods, sizeof(struct pcr_softc)); + DRIVER_MODULE(pcr, cpu, pcr_driver, 0, 0); /* diff --git a/sys/powerpc/cpufreq/pmcr.c b/sys/powerpc/cpufreq/pmcr.c --- a/sys/powerpc/cpufreq/pmcr.c +++ b/sys/powerpc/cpufreq/pmcr.c @@ -99,15 +99,12 @@ DEVMETHOD(cpufreq_drv_get, pmcr_get), DEVMETHOD(cpufreq_drv_type, pmcr_type), DEVMETHOD(cpufreq_drv_settings, pmcr_settings), - {0, 0} -}; -static driver_t pmcr_driver = { - "pmcr", - pmcr_methods, - sizeof(struct pmcr_softc) + DEVMETHOD_END }; +DEFINE_CLASS_0(pmcr, pmcr_driver, pmcr_methods, sizeof(struct pmcr_softc)); + DRIVER_MODULE(pmcr, cpu, pmcr_driver, 0, 0); static void diff --git a/sys/powerpc/cpufreq/pmufreq.c b/sys/powerpc/cpufreq/pmufreq.c --- a/sys/powerpc/cpufreq/pmufreq.c +++ b/sys/powerpc/cpufreq/pmufreq.c @@ -67,15 +67,13 @@ DEVMETHOD(cpufreq_drv_get, pmufreq_get), DEVMETHOD(cpufreq_drv_type, pmufreq_type), DEVMETHOD(cpufreq_drv_settings, pmufreq_settings), - {0, 0} -}; -static driver_t pmufreq_driver = { - "pmufreq", - pmufreq_methods, - sizeof(struct pmufreq_softc) + DEVMETHOD_END }; +DEFINE_CLASS_0(pmufreq, pmufreq_driver, pmufreq_methods, + sizeof(struct pmufreq_softc)); + DRIVER_MODULE(pmufreq, cpu, pmufreq_driver, 0, 0); static void diff --git a/sys/powerpc/include/platformvar.h b/sys/powerpc/include/platformvar.h --- a/sys/powerpc/include/platformvar.h +++ b/sys/powerpc/include/platformvar.h @@ -40,7 +40,8 @@ * PLATFORMMETHOD(platform_mem_regions, ofw_mem_regions), * ... * PLATFORMMETHOD(platform_smp_first_cpu, chrp_smp_first_cpu), - * { 0, 0 } + * + * PLATFORMMETHOD_END * }; * * static platform_def_t chrp_platform = { diff --git a/sys/powerpc/mambo/mambo.c b/sys/powerpc/mambo/mambo.c --- a/sys/powerpc/mambo/mambo.c +++ b/sys/powerpc/mambo/mambo.c @@ -66,11 +66,7 @@ DEVMETHOD_END }; -static driver_t mambobus_driver = { - "mambo", - mambobus_methods, - 0 -}; +DEFINE_CLASS_0(mambo, mambobus_driver, mambobus_methods, 0); DRIVER_MODULE(mambo, ofwbus, mambobus_driver, 0, 0); diff --git a/sys/powerpc/mambo/mambo_disk.c b/sys/powerpc/mambo/mambo_disk.c --- a/sys/powerpc/mambo/mambo_disk.c +++ b/sys/powerpc/mambo/mambo_disk.c @@ -263,13 +263,11 @@ DEVMETHOD(device_probe, mambodisk_probe), DEVMETHOD(device_attach, mambodisk_attach), DEVMETHOD(device_detach, mambodisk_detach), - {0, 0}, -}; -static driver_t mambodisk_driver = { - "mambodisk", - mambodisk_methods, - sizeof(struct mambodisk_softc), + DEVMETHOD_END }; +DEFINE_CLASS_0(mambodisk, mambodisk_driver, mambodisk_methods, + sizeof(struct mambodisk_softc)); + DRIVER_MODULE(mambodisk, mambo, mambodisk_driver, 0, 0); diff --git a/sys/powerpc/mikrotik/rb_led.c b/sys/powerpc/mikrotik/rb_led.c --- a/sys/powerpc/mikrotik/rb_led.c +++ b/sys/powerpc/mikrotik/rb_led.c @@ -58,11 +58,7 @@ DEVMETHOD_END }; -static driver_t rbled_driver = { - "rbled", - rbled_methods, - sizeof(struct rbled_softc), -}; +DEFINE_CLASS_0(rbled, rbled_driver, rbled_methods, sizeof(struct rbled_softc)); DRIVER_MODULE(rbled, simplebus, rbled_driver, 0, 0); diff --git a/sys/powerpc/mpc85xx/atpic.c b/sys/powerpc/mpc85xx/atpic.c --- a/sys/powerpc/mpc85xx/atpic.c +++ b/sys/powerpc/mpc85xx/atpic.c @@ -98,14 +98,11 @@ DEVMETHOD(pic_translate_code, atpic_ofw_translate_code), - { 0, 0 }, + DEVMETHOD_END }; -static driver_t atpic_isa_driver = { - "atpic", - atpic_isa_methods, - sizeof(struct atpic_softc) -}; +DEFINE_CLASS_0(atpic, atpic_isa_driver, atpic_isa_methods, + sizeof(struct atpic_softc)); static struct isa_pnp_id atpic_ids[] = { { 0x0000d041 /* PNP0000 */, "AT interrupt controller" }, diff --git a/sys/powerpc/mpc85xx/ds1553_bus_fdt.c b/sys/powerpc/mpc85xx/ds1553_bus_fdt.c --- a/sys/powerpc/mpc85xx/ds1553_bus_fdt.c +++ b/sys/powerpc/mpc85xx/ds1553_bus_fdt.c @@ -60,15 +60,12 @@ /* clock interface */ DEVMETHOD(clock_gettime, ds1553_gettime), DEVMETHOD(clock_settime, ds1553_settime), - { 0, 0 } -}; -static driver_t rtc_driver = { - "rtc", - rtc_methods, - sizeof(struct ds1553_softc), + DEVMETHOD_END }; +DEFINE_CLASS_0(rtc, rtc_driver, rtc_methods, sizeof(struct ds1553_softc)); + DRIVER_MODULE(rtc, lbc, rtc_driver, 0, 0); static int diff --git a/sys/powerpc/mpc85xx/fsl_diu.c b/sys/powerpc/mpc85xx/fsl_diu.c --- a/sys/powerpc/mpc85xx/fsl_diu.c +++ b/sys/powerpc/mpc85xx/fsl_diu.c @@ -450,13 +450,10 @@ /* Framebuffer service methods */ DEVMETHOD(fb_getinfo, diu_fb_getinfo), - { 0, 0 } -}; -static driver_t diu_driver = { - "fb", - diu_methods, - sizeof(struct diu_softc), + DEVMETHOD_END }; +DEFINE_CLASS_0(fb, diu_driver, diu_methods, sizeof(struct diu_softc)); + DRIVER_MODULE(fb, simplebus, diu_driver, 0, 0); diff --git a/sys/powerpc/mpc85xx/fsl_espi.c b/sys/powerpc/mpc85xx/fsl_espi.c --- a/sys/powerpc/mpc85xx/fsl_espi.c +++ b/sys/powerpc/mpc85xx/fsl_espi.c @@ -421,10 +421,7 @@ DEVMETHOD_END }; -static driver_t fsl_espi_driver = { - "spi", - fsl_espi_methods, - sizeof(struct fsl_espi_softc), -}; +DEFINE_CLASS_0(spi, fsl_espi_driver, fsl_espi_methods, + sizeof(struct fsl_espi_softc)); DRIVER_MODULE(fsl_espi, simplebus, fsl_espi_driver, 0, 0); diff --git a/sys/powerpc/mpc85xx/fsl_sata.c b/sys/powerpc/mpc85xx/fsl_sata.c --- a/sys/powerpc/mpc85xx/fsl_sata.c +++ b/sys/powerpc/mpc85xx/fsl_sata.c @@ -546,14 +546,12 @@ DEVMETHOD(device_detach, fsl_sata_detach), DEVMETHOD(device_suspend, fsl_sata_suspend), DEVMETHOD(device_resume, fsl_sata_resume), + DEVMETHOD_END }; -static driver_t fsl_satach_driver = { - "fslsata", - fsl_satach_methods, - sizeof(struct fsl_sata_channel) -}; +DEFINE_CLASS_0(fslsata, fsl_satach_driver, fsl_satach_methods, + sizeof(struct fsl_sata_channel)); DRIVER_MODULE(fsl_satach, simplebus, fsl_satach_driver, NULL, NULL); diff --git a/sys/powerpc/mpc85xx/i2c.c b/sys/powerpc/mpc85xx/i2c.c --- a/sys/powerpc/mpc85xx/i2c.c +++ b/sys/powerpc/mpc85xx/i2c.c @@ -111,15 +111,12 @@ DEVMETHOD(iicbus_write, i2c_write), DEVMETHOD(iicbus_transfer, iicbus_transfer_gen), DEVMETHOD(ofw_bus_get_node, i2c_get_node), - { 0, 0 } -}; -static driver_t i2c_driver = { - "iichb", - i2c_methods, - sizeof(struct i2c_softc), + DEVMETHOD_END }; +DEFINE_CLASS_0(iichb, i2c_driver, i2c_methods, sizeof(struct i2c_softc)); + DRIVER_MODULE(i2c, simplebus, i2c_driver, 0, 0); DRIVER_MODULE(iicbus, i2c, iicbus_driver, 0, 0); diff --git a/sys/powerpc/mpc85xx/lbc.c b/sys/powerpc/mpc85xx/lbc.c --- a/sys/powerpc/mpc85xx/lbc.c +++ b/sys/powerpc/mpc85xx/lbc.c @@ -116,15 +116,12 @@ DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - { 0, 0 } -}; -static driver_t lbc_driver = { - "lbc", - lbc_methods, - sizeof(struct lbc_softc) + DEVMETHOD_END }; +DEFINE_CLASS_0(lbc, lbc_driver, lbc_methods, sizeof(struct lbc_softc)); + EARLY_DRIVER_MODULE(lbc, ofwbus, lbc_driver, 0, 0, BUS_PASS_BUS); /* diff --git a/sys/powerpc/mpc85xx/mpc85xx_cache.c b/sys/powerpc/mpc85xx/mpc85xx_cache.c --- a/sys/powerpc/mpc85xx/mpc85xx_cache.c +++ b/sys/powerpc/mpc85xx/mpc85xx_cache.c @@ -147,11 +147,8 @@ DEVMETHOD_END }; -static driver_t mpc85xx_cache_driver = { - "cache", - mpc85xx_cache_methods, - sizeof(struct mpc85xx_cache_softc), -}; +DEFINE_CLASS_0(cache, mpc85xx_cache_driver, mpc85xx_cache_methods, + sizeof(struct mpc85xx_cache_softc)); EARLY_DRIVER_MODULE(mpc85xx_cache, simplebus, mpc85xx_cache_driver, NULL, NULL, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); diff --git a/sys/powerpc/mpc85xx/mpc85xx_gpio.c b/sys/powerpc/mpc85xx/mpc85xx_gpio.c --- a/sys/powerpc/mpc85xx/mpc85xx_gpio.c +++ b/sys/powerpc/mpc85xx/mpc85xx_gpio.c @@ -279,11 +279,8 @@ DEVMETHOD_END }; -static driver_t mpc85xx_gpio_driver = { - "gpio", - mpc85xx_gpio_methods, - sizeof(struct mpc85xx_gpio_softc), -}; +DEFINE_CLASS_0(gpio, mpc85xx_gpio_driver, mpc85xx_gpio_methods, + sizeof(struct mpc85xx_gpio_softc)); EARLY_DRIVER_MODULE(mpc85xx_gpio, simplebus, mpc85xx_gpio_driver, NULL, NULL, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); diff --git a/sys/powerpc/mpc85xx/pci_mpc85xx.c b/sys/powerpc/mpc85xx/pci_mpc85xx.c --- a/sys/powerpc/mpc85xx/pci_mpc85xx.c +++ b/sys/powerpc/mpc85xx/pci_mpc85xx.c @@ -947,11 +947,8 @@ DEVMETHOD_END }; -static driver_t fsl_msi_driver = { - "fsl_msi", - fsl_msi_methods, - sizeof(struct fsl_msi_softc) -}; +DEFINE_CLASS_0(fsl_msi, fsl_msi_driver, fsl_msi_methods, + sizeof(struct fsl_msi_softc)); EARLY_DRIVER_MODULE(fsl_msi, simplebus, fsl_msi_driver, 0, 0, BUS_PASS_INTERRUPT + 1); diff --git a/sys/powerpc/mpc85xx/platform_mpc85xx.c b/sys/powerpc/mpc85xx/platform_mpc85xx.c --- a/sys/powerpc/mpc85xx/platform_mpc85xx.c +++ b/sys/powerpc/mpc85xx/platform_mpc85xx.c @@ -617,14 +617,12 @@ static device_method_t mpc85xx_rcpm_methods[] = { DEVMETHOD(device_probe, mpc85xx_rcpm_probe), DEVMETHOD(device_attach, mpc85xx_rcpm_attach), + DEVMETHOD_END }; -static driver_t mpc85xx_rcpm_driver = { - "rcpm", - mpc85xx_rcpm_methods, - sizeof(struct mpc85xx_rcpm_softc) -}; +DEFINE_CLASS_0(rcpm, mpc85xx_rcpm_driver, mpc85xx_rcpm_methods, + sizeof(struct mpc85xx_rcpm_softc)); EARLY_DRIVER_MODULE(mpc85xx_rcpm, simplebus, mpc85xx_rcpm_driver, 0, 0, BUS_PASS_BUS); @@ -691,14 +689,12 @@ static device_method_t mpc85xx_guts_methods[] = { DEVMETHOD(device_probe, mpc85xx_guts_probe), DEVMETHOD(device_attach, mpc85xx_guts_attach), + DEVMETHOD_END }; -static driver_t mpc85xx_guts_driver = { - "guts", - mpc85xx_guts_methods, - sizeof(struct mpc85xx_guts_softc) -}; +DEFINE_CLASS_0(guts, mpc85xx_guts_driver, mpc85xx_guts_methods, + sizeof(struct mpc85xx_guts_softc)); EARLY_DRIVER_MODULE(mpc85xx_guts, simplebus, mpc85xx_guts_driver, 0, 0, BUS_PASS_BUS); diff --git a/sys/powerpc/ofw/ofw_syscons.c b/sys/powerpc/ofw/ofw_syscons.c --- a/sys/powerpc/ofw/ofw_syscons.c +++ b/sys/powerpc/ofw/ofw_syscons.c @@ -1032,7 +1032,8 @@ DEVMETHOD(device_identify, ofwfb_scidentify), DEVMETHOD(device_probe, ofwfb_scprobe), DEVMETHOD(device_attach, ofwfb_scattach), - { 0, 0 } + + DEVMETHOD_END }; static driver_t ofwfb_sc_driver = { diff --git a/sys/powerpc/ofw/openpic_ofw.c b/sys/powerpc/ofw/openpic_ofw.c --- a/sys/powerpc/ofw/openpic_ofw.c +++ b/sys/powerpc/ofw/openpic_ofw.c @@ -86,11 +86,8 @@ DEVMETHOD_END }; -static driver_t openpic_ofw_driver = { - "openpic", - openpic_ofw_methods, - sizeof(struct openpic_softc), -}; +DEFINE_CLASS_0(openpic, openpic_ofw_driver, openpic_ofw_methods, + sizeof(struct openpic_softc)); EARLY_DRIVER_MODULE(openpic, ofwbus, openpic_ofw_driver, 0, 0, BUS_PASS_INTERRUPT); diff --git a/sys/powerpc/powermac/ata_kauai.c b/sys/powerpc/powermac/ata_kauai.c --- a/sys/powerpc/powermac/ata_kauai.c +++ b/sys/powerpc/powermac/ata_kauai.c @@ -98,6 +98,7 @@ /* ATA interface */ DEVMETHOD(ata_setmode, ata_kauai_setmode), + DEVMETHOD_END }; @@ -113,11 +114,8 @@ uint32_t pioconf[2]; }; -static driver_t ata_kauai_driver = { - "ata", - ata_kauai_methods, - sizeof(struct ata_kauai_softc), -}; +DEFINE_CLASS_0(ata, ata_kauai_driver, ata_kauai_methods, + sizeof(struct ata_kauai_softc)); DRIVER_MODULE(ata, pci, ata_kauai_driver, NULL, NULL); MODULE_DEPEND(ata, ata, 1, 1, 1); diff --git a/sys/powerpc/powermac/ata_macio.c b/sys/powerpc/powermac/ata_macio.c --- a/sys/powerpc/powermac/ata_macio.c +++ b/sys/powerpc/powermac/ata_macio.c @@ -126,6 +126,7 @@ /* ATA interface */ DEVMETHOD(ata_setmode, ata_macio_setmode), + DEVMETHOD_END }; @@ -141,11 +142,8 @@ uint32_t pioconf[2]; }; -static driver_t ata_macio_driver = { - "ata", - ata_macio_methods, - sizeof(struct ata_macio_softc), -}; +DEFINE_CLASS_0(ata, ata_macio_driver, ata_macio_methods, + sizeof(struct ata_macio_softc)); DRIVER_MODULE(ata, macio, ata_macio_driver, NULL, NULL); MODULE_DEPEND(ata, ata, 1, 1, 1); diff --git a/sys/powerpc/powermac/atibl.c b/sys/powerpc/powermac/atibl.c --- a/sys/powerpc/powermac/atibl.c +++ b/sys/powerpc/powermac/atibl.c @@ -89,15 +89,13 @@ DEVMETHOD(device_attach, atibl_attach), DEVMETHOD(device_suspend, atibl_suspend), DEVMETHOD(device_resume, atibl_resume), - {0, 0}, -}; -static driver_t atibl_driver = { - "backlight", - atibl_methods, - sizeof(struct atibl_softc) + DEVMETHOD_END }; +DEFINE_CLASS_0(backlight, atibl_driver, atibl_methods, + sizeof(struct atibl_softc)); + DRIVER_MODULE(atibl, vgapci, atibl_driver, 0, 0); static void diff --git a/sys/powerpc/powermac/cpcht.c b/sys/powerpc/powermac/cpcht.c --- a/sys/powerpc/powermac/cpcht.c +++ b/sys/powerpc/powermac/cpcht.c @@ -529,7 +529,7 @@ DEVMETHOD(pic_mask, openpic_mask), DEVMETHOD(pic_unmask, openpic_cpcht_unmask), - { 0, 0 }, + DEVMETHOD_END }; struct openpic_cpcht_softc { @@ -538,11 +538,8 @@ struct mtx sc_ht_mtx; }; -static driver_t openpic_cpcht_driver = { - "htpic", - openpic_cpcht_methods, - sizeof(struct openpic_cpcht_softc), -}; +DEFINE_CLASS_0(htpic, openpic_cpcht_driver, openpic_cpcht_methods, + sizeof(struct openpic_cpcht_softc)); EARLY_DRIVER_MODULE(openpic, unin, openpic_cpcht_driver, 0, 0, BUS_PASS_INTERRUPT); diff --git a/sys/powerpc/powermac/cuda.c b/sys/powerpc/powermac/cuda.c --- a/sys/powerpc/powermac/cuda.c +++ b/sys/powerpc/powermac/cuda.c @@ -104,11 +104,7 @@ DEVMETHOD_END }; -static driver_t cuda_driver = { - "cuda", - cuda_methods, - sizeof(struct cuda_softc), -}; +DEFINE_CLASS_0(cuda, cuda_driver, cuda_methods, sizeof(struct cuda_softc)); DRIVER_MODULE(cuda, macio, cuda_driver, 0, 0); DRIVER_MODULE(adb, cuda, adb_driver, 0, 0); diff --git a/sys/powerpc/powermac/fcu.c b/sys/powerpc/powermac/fcu.c --- a/sys/powerpc/powermac/fcu.c +++ b/sys/powerpc/powermac/fcu.c @@ -118,15 +118,12 @@ /* Device interface */ DEVMETHOD(device_probe, fcu_probe), DEVMETHOD(device_attach, fcu_attach), - { 0, 0 }, -}; -static driver_t fcu_driver = { - "fcu", - fcu_methods, - sizeof(struct fcu_softc) + DEVMETHOD_END }; +DEFINE_CLASS_0(fcu, fcu_driver, fcu_methods, sizeof(struct fcu_softc)); + DRIVER_MODULE(fcu, iicbus, fcu_driver, 0, 0); static MALLOC_DEFINE(M_FCU, "fcu", "FCU Sensor Information"); diff --git a/sys/powerpc/powermac/grackle.c b/sys/powerpc/powermac/grackle.c --- a/sys/powerpc/powermac/grackle.c +++ b/sys/powerpc/powermac/grackle.c @@ -305,13 +305,10 @@ /* Device interface */ DEVMETHOD(device_probe, grackle_hb_probe), DEVMETHOD(device_attach, grackle_hb_attach), - { 0, 0 } -}; -static driver_t grackle_hb_driver = { - "grackle_hb", - grackle_hb_methods, - 1, + DEVMETHOD_END }; +DEFINE_CLASS_0(grackle_hb, grackle_hb_driver, grackle_hb_methods, 1); + DRIVER_MODULE(grackle_hb, pci, grackle_hb_driver, 0, 0); diff --git a/sys/powerpc/powermac/hrowpic.c b/sys/powerpc/powermac/hrowpic.c --- a/sys/powerpc/powermac/hrowpic.c +++ b/sys/powerpc/powermac/hrowpic.c @@ -83,14 +83,11 @@ DEVMETHOD(pic_mask, hrowpic_mask), DEVMETHOD(pic_unmask, hrowpic_unmask), - { 0, 0 }, + DEVMETHOD_END }; -static driver_t hrowpic_driver = { - "hrowpic", - hrowpic_methods, - sizeof(struct hrowpic_softc) -}; +DEFINE_CLASS_0(hrowpic, hrowpic_driver, hrowpic_methods, + sizeof(struct hrowpic_softc)); DRIVER_MODULE(hrowpic, macio, hrowpic_driver, 0, 0); diff --git a/sys/powerpc/powermac/kiic.c b/sys/powerpc/powermac/kiic.c --- a/sys/powerpc/powermac/kiic.c +++ b/sys/powerpc/powermac/kiic.c @@ -135,15 +135,12 @@ /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, kiic_get_node), - { 0, 0 } -}; -static driver_t kiic_driver = { - "iichb", - kiic_methods, - sizeof(struct kiic_softc) + DEVMETHOD_END }; +DEFINE_CLASS_0(iichb, kiic_driver, kiic_methods, sizeof(struct kiic_softc)); + DRIVER_MODULE(kiic, macio, kiic_driver, 0, 0); DRIVER_MODULE(kiic, unin, kiic_driver, 0, 0); diff --git a/sys/powerpc/powermac/macgpio.c b/sys/powerpc/powermac/macgpio.c --- a/sys/powerpc/powermac/macgpio.c +++ b/sys/powerpc/powermac/macgpio.c @@ -111,15 +111,13 @@ DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - { 0, 0 } -}; -static driver_t macgpio_pci_driver = { - "macgpio", - macgpio_methods, - sizeof(struct macgpio_softc) + DEVMETHOD_END }; +DEFINE_CLASS_0(macgpio, macgpio_pci_driver, macgpio_methods, + sizeof(struct macgpio_softc)); + EARLY_DRIVER_MODULE(macgpio, macio, macgpio_pci_driver, 0, 0, BUS_PASS_BUS); struct macgpio_devinfo { diff --git a/sys/powerpc/powermac/macio.c b/sys/powerpc/powermac/macio.c --- a/sys/powerpc/powermac/macio.c +++ b/sys/powerpc/powermac/macio.c @@ -137,15 +137,13 @@ DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - { 0, 0 } -}; -static driver_t macio_pci_driver = { - "macio", - macio_methods, - sizeof(struct macio_softc) + DEVMETHOD_END }; +DEFINE_CLASS_0(macio, macio_pci_driver, macio_methods, + sizeof(struct macio_softc)); + EARLY_DRIVER_MODULE(macio, pci, macio_pci_driver, 0, 0, BUS_PASS_BUS); /* diff --git a/sys/powerpc/powermac/nvbl.c b/sys/powerpc/powermac/nvbl.c --- a/sys/powerpc/powermac/nvbl.c +++ b/sys/powerpc/powermac/nvbl.c @@ -67,15 +67,12 @@ DEVMETHOD(device_identify, nvbl_identify), DEVMETHOD(device_probe, nvbl_probe), DEVMETHOD(device_attach, nvbl_attach), - {0, 0}, -}; -static driver_t nvbl_driver = { - "backlight", - nvbl_methods, - sizeof(struct nvbl_softc) + DEVMETHOD_END }; +DEFINE_CLASS_0(backlight, nvbl_driver, nvbl_methods, sizeof(struct nvbl_softc)); + DRIVER_MODULE(nvbl, vgapci, nvbl_driver, 0, 0); static void diff --git a/sys/powerpc/powermac/pmu.c b/sys/powerpc/powermac/pmu.c --- a/sys/powerpc/powermac/pmu.c +++ b/sys/powerpc/powermac/pmu.c @@ -145,11 +145,7 @@ DEVMETHOD_END }; -static driver_t pmu_driver = { - "pmu", - pmu_methods, - sizeof(struct pmu_softc), -}; +DEFINE_CLASS_0(pmu, pmu_driver, pmu_methods, sizeof(struct pmu_softc)); EARLY_DRIVER_MODULE(pmu, macio, pmu_driver, 0, 0, BUS_PASS_RESOURCE); DRIVER_MODULE(adb, pmu, adb_driver, 0, 0); @@ -161,15 +157,12 @@ /* Device interface */ DEVMETHOD(device_probe, pmuextint_probe), DEVMETHOD(device_attach, pmuextint_attach), - {0,0} -}; -static driver_t pmuextint_driver = { - "pmuextint", - pmuextint_methods, - 0 + DEVMETHOD_END }; +DEFINE_CLASS_0(pmuextint, pmuextint_driver, pmuextint_methods, 0); + EARLY_DRIVER_MODULE(pmuextint, macgpio, pmuextint_driver, 0, 0, BUS_PASS_RESOURCE); diff --git a/sys/powerpc/powermac/pswitch.c b/sys/powerpc/powermac/pswitch.c --- a/sys/powerpc/powermac/pswitch.c +++ b/sys/powerpc/powermac/pswitch.c @@ -59,15 +59,13 @@ /* Device interface */ DEVMETHOD(device_probe, pswitch_probe), DEVMETHOD(device_attach, pswitch_attach), - { 0, 0 } -}; -static driver_t pswitch_driver = { - "pswitch", - pswitch_methods, - sizeof(struct pswitch_softc) + DEVMETHOD_END }; +DEFINE_CLASS_0(pswitch, pswitch_driver, pswitch_methods, + sizeof(struct pswitch_softc)); + EARLY_DRIVER_MODULE(pswitch, macgpio, pswitch_driver, 0, 0, BUS_PASS_RESOURCE); static int diff --git a/sys/powerpc/powermac/smu.c b/sys/powerpc/powermac/smu.c --- a/sys/powerpc/powermac/smu.c +++ b/sys/powerpc/powermac/smu.c @@ -201,14 +201,10 @@ DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - { 0, 0 }, + DEVMETHOD_END }; -static driver_t smu_driver = { - "smu", - smu_methods, - sizeof(struct smu_softc) -}; +DEFINE_CLASS_0(smu, smu_driver, smu_methods, sizeof(struct smu_softc)); DRIVER_MODULE(smu, ofwbus, smu_driver, 0, 0); static MALLOC_DEFINE(M_SMU, "smu", "SMU Sensor Information"); @@ -617,15 +613,12 @@ /* Device interface */ DEVMETHOD(device_probe, doorbell_probe), DEVMETHOD(device_attach, doorbell_attach), - { 0, 0 }, -}; -static driver_t doorbell_driver = { - "smudoorbell", - doorbell_methods, - 0 + DEVMETHOD_END }; +DEFINE_CLASS_0(smudoorbell, doorbell_driver, doorbell_methods, 0); + EARLY_DRIVER_MODULE(smudoorbell, macgpio, doorbell_driver, 0, 0, BUS_PASS_SUPPORTDEV); @@ -1396,7 +1389,8 @@ /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, smuiic_get_node), - { 0, 0 } + + DEVMETHOD_END }; struct smuiic_softc { @@ -1405,11 +1399,8 @@ int sc_busno; }; -static driver_t smuiic_driver = { - "iichb", - smuiic_methods, - sizeof(struct smuiic_softc) -}; +DEFINE_CLASS_0(iichb, smuiic_driver, smuiic_methods, + sizeof(struct smuiic_softc)); DRIVER_MODULE(smuiic, smu, smuiic_driver, 0, 0); diff --git a/sys/powerpc/powermac/smusat.c b/sys/powerpc/powermac/smusat.c --- a/sys/powerpc/powermac/smusat.c +++ b/sys/powerpc/powermac/smusat.c @@ -68,7 +68,8 @@ /* Device interface */ DEVMETHOD(device_probe, smusat_probe), DEVMETHOD(device_attach, smusat_attach), - { 0, 0 }, + + DEVMETHOD_END }; struct smusat_softc { @@ -79,11 +80,8 @@ time_t sc_last_update; }; -static driver_t smusat_driver = { - "smusat", - smusat_methods, - sizeof(struct smusat_softc) -}; +DEFINE_CLASS_0(smusat, smusat_driver, smusat_methods, + sizeof(struct smusat_softc)); DRIVER_MODULE(smusat, iicbus, smusat_driver, 0, 0); diff --git a/sys/powerpc/powermac/tbgpio.c b/sys/powerpc/powermac/tbgpio.c --- a/sys/powerpc/powermac/tbgpio.c +++ b/sys/powerpc/powermac/tbgpio.c @@ -47,6 +47,7 @@ /* Device interface */ DEVMETHOD(device_probe, tbgpio_probe), DEVMETHOD(device_attach, tbgpio_attach), + DEVMETHOD_END }; @@ -55,11 +56,8 @@ uint32_t sc_mask; }; -static driver_t tbgpio_driver = { - "tbgpio", - tbgpio_methods, - sizeof(struct tbgpio_softc) -}; +DEFINE_CLASS_0(tbgpio, tbgpio_driver, tbgpio_methods, + sizeof(struct tbgpio_softc)); EARLY_DRIVER_MODULE(tbgpio, macgpio, tbgpio_driver, 0, 0, BUS_PASS_CPU); diff --git a/sys/powerpc/powermac/uninorth.c b/sys/powerpc/powermac/uninorth.c --- a/sys/powerpc/powermac/uninorth.c +++ b/sys/powerpc/powermac/uninorth.c @@ -136,15 +136,13 @@ DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - { 0, 0 } -}; -static driver_t unin_chip_driver = { - "unin", - unin_chip_methods, - sizeof(struct unin_chip_softc) + DEVMETHOD_END }; +DEFINE_CLASS_0(unin, unin_chip_driver, unin_chip_methods, + sizeof(struct unin_chip_softc)); + /* * Assume there is only one unin chip in a PowerMac, so that pmu.c functions can * suspend the chip after the whole rest of the device tree is suspended, not diff --git a/sys/powerpc/powermac/vcoregpio.c b/sys/powerpc/powermac/vcoregpio.c --- a/sys/powerpc/powermac/vcoregpio.c +++ b/sys/powerpc/powermac/vcoregpio.c @@ -51,15 +51,12 @@ /* Device interface */ DEVMETHOD(device_probe, vcoregpio_probe), DEVMETHOD(device_attach, vcoregpio_attach), - { 0, 0 }, -}; -static driver_t vcoregpio_driver = { - "vcoregpio", - vcoregpio_methods, - 0 + DEVMETHOD_END }; +DEFINE_CLASS_0(vcoregpio, vcoregpio_driver, vcoregpio_methods, 0); + DRIVER_MODULE(vcoregpio, macgpio, vcoregpio_driver, 0, 0); static int diff --git a/sys/powerpc/powernv/opal_console.c b/sys/powerpc/powernv/opal_console.c --- a/sys/powerpc/powernv/opal_console.c +++ b/sys/powerpc/powernv/opal_console.c @@ -104,11 +104,8 @@ DEVMETHOD_END }; -static driver_t uart_opal_driver = { - "uart", - uart_opal_methods, - sizeof(struct uart_opal_softc), -}; +DEFINE_CLASS_0(uart, uart_opal_driver, uart_opal_methods, + sizeof(struct uart_opal_softc)); DRIVER_MODULE(uart_opal, opalcons, uart_opal_driver, 0, 0); @@ -603,10 +600,6 @@ DEVMETHOD_END }; -static driver_t opalcons_driver = { - "opalcons", - opalcons_methods, - 0 -}; +DEFINE_CLASS_0(opalcons, opalcons_driver, opalcons_methods, 0); DRIVER_MODULE(opalcons, opal, opalcons_driver, 0, 0); diff --git a/sys/powerpc/powernv/opal_dev.c b/sys/powerpc/powernv/opal_dev.c --- a/sys/powerpc/powernv/opal_dev.c +++ b/sys/powerpc/powernv/opal_dev.c @@ -85,11 +85,7 @@ DEVMETHOD_END }; -static driver_t opaldev_driver = { - "opal", - opaldev_methods, - 0 -}; +DEFINE_CLASS_0(opal, opaldev_driver, opaldev_methods, 0); EARLY_DRIVER_MODULE(opaldev, ofwbus, opaldev_driver, 0, 0, BUS_PASS_BUS); diff --git a/sys/powerpc/powernv/opal_flash.c b/sys/powerpc/powernv/opal_flash.c --- a/sys/powerpc/powernv/opal_flash.c +++ b/sys/powerpc/powernv/opal_flash.c @@ -89,11 +89,8 @@ DEVMETHOD_END }; -static driver_t opalflash_driver = { - "opalflash", - opalflash_methods, - sizeof(struct opalflash_softc) -}; +DEFINE_CLASS_0(opalflash, opalflash_driver, opalflash_methods, + sizeof(struct opalflash_softc)); DRIVER_MODULE(opalflash, opal, opalflash_driver, 0, 0); diff --git a/sys/powerpc/powernv/opal_i2c.c b/sys/powerpc/powernv/opal_i2c.c --- a/sys/powerpc/powernv/opal_i2c.c +++ b/sys/powerpc/powernv/opal_i2c.c @@ -105,11 +105,8 @@ mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->dev), \ "i2c", MTX_DEF) -static driver_t opal_i2c_driver = { - "iichb", - opal_i2c_methods, - sizeof(struct opal_i2c_softc), -}; +DEFINE_CLASS_0(iichb, opal_i2c_driver, opal_i2c_methods, + sizeof(struct opal_i2c_softc)); static int opal_i2c_probe(device_t dev) diff --git a/sys/powerpc/powernv/opal_nvram.c b/sys/powerpc/powernv/opal_nvram.c --- a/sys/powerpc/powernv/opal_nvram.c +++ b/sys/powerpc/powernv/opal_nvram.c @@ -82,15 +82,13 @@ DEVMETHOD(device_probe, opal_nvram_probe), DEVMETHOD(device_attach, opal_nvram_attach), DEVMETHOD(device_detach, opal_nvram_detach), - { 0, 0 } -}; -static driver_t opal_nvram_driver = { - "opal_nvram", - opal_nvram_methods, - sizeof(struct opal_nvram_softc) + DEVMETHOD_END }; +DEFINE_CLASS_0(opal_nvram, opal_nvram_driver, opal_nvram_methods, + sizeof(struct opal_nvram_softc)); + DRIVER_MODULE(opal_nvram, opal, opal_nvram_driver, 0, 0); /* diff --git a/sys/powerpc/powernv/opal_sensor.c b/sys/powerpc/powernv/opal_sensor.c --- a/sys/powerpc/powernv/opal_sensor.c +++ b/sys/powerpc/powernv/opal_sensor.c @@ -244,14 +244,13 @@ static device_method_t opal_sensor_methods[] = { DEVMETHOD(device_probe, opal_sensor_probe), DEVMETHOD(device_attach, opal_sensor_attach), -}; -static driver_t opal_sensor_driver = { - "opal_sensor", - opal_sensor_methods, - sizeof(struct opal_sensor_softc) + DEVMETHOD_END }; +DEFINE_CLASS_0(opal_sensor, opal_sensor_driver, opal_sensor_methods, + sizeof(struct opal_sensor_softc)); + DRIVER_MODULE(opal_sensor, opalsens, opal_sensor_driver, NULL, NULL); static int @@ -315,10 +314,6 @@ DEVMETHOD_END }; -static driver_t opalsens_driver = { - "opalsens", - opalsens_methods, - 0 -}; +DEFINE_CLASS_0(opalsens, opalsens_driver, opalsens_methods, 0); DRIVER_MODULE(opalsens, opal, opalsens_driver, NULL, NULL); diff --git a/sys/powerpc/powernv/platform_powernv.c b/sys/powerpc/powernv/platform_powernv.c --- a/sys/powerpc/powernv/platform_powernv.c +++ b/sys/powerpc/powernv/platform_powernv.c @@ -99,7 +99,8 @@ PLATFORMMETHOD(platform_node_numa_domain, powernv_node_numa_domain), PLATFORMMETHOD(platform_reset, powernv_reset), - { 0, 0 } + + PLATFORMMETHOD_END }; static platform_def_t powernv_platform = { diff --git a/sys/powerpc/powernv/xive.c b/sys/powerpc/powernv/xive.c --- a/sys/powerpc/powernv/xive.c +++ b/sys/powerpc/powernv/xive.c @@ -188,17 +188,9 @@ uint32_t chip; }; -static driver_t xive_driver = { - "xive", - xive_methods, - sizeof(struct xive_softc) -}; +DEFINE_CLASS_0(xive, xive_driver, xive_methods, sizeof(struct xive_softc)); -static driver_t xics_driver = { - "xivevc", - xics_methods, - 0 -}; +DEFINE_CLASS_0(xivevc, xics_driver, xics_methods, 0); EARLY_DRIVER_MODULE(xive, ofwbus, xive_driver, 0, 0, BUS_PASS_INTERRUPT - 1); EARLY_DRIVER_MODULE(xivevc, ofwbus, xics_driver, 0, 0, BUS_PASS_INTERRUPT); diff --git a/sys/powerpc/ps3/ehci_ps3.c b/sys/powerpc/ps3/ehci_ps3.c --- a/sys/powerpc/ps3/ehci_ps3.c +++ b/sys/powerpc/ps3/ehci_ps3.c @@ -165,11 +165,7 @@ DEVMETHOD_END }; -static driver_t ehci_ps3_driver = { - .name = "ehci", - .methods = ehci_ps3_methods, - .size = sizeof(ehci_softc_t), -}; +DEFINE_CLASS_0(ehci, ehci_ps3_driver, ehci_ps3_methods, sizeof(ehci_softc_t)); DRIVER_MODULE(ehci_ps3, ps3bus, ehci_ps3_driver, 0, 0); MODULE_DEPEND(ehci_ps3, usb, 1, 1, 1); diff --git a/sys/powerpc/ps3/if_glc.c b/sys/powerpc/ps3/if_glc.c --- a/sys/powerpc/ps3/if_glc.c +++ b/sys/powerpc/ps3/if_glc.c @@ -81,15 +81,12 @@ /* Device interface */ DEVMETHOD(device_probe, glc_probe), DEVMETHOD(device_attach, glc_attach), - { 0, 0 } -}; -static driver_t glc_driver = { - "glc", - glc_methods, - sizeof(struct glc_softc) + DEVMETHOD_END }; +DEFINE_CLASS_0(glc, glc_driver, glc_methods, sizeof(struct glc_softc)); + DRIVER_MODULE(glc, ps3bus, glc_driver, 0, 0); static int diff --git a/sys/powerpc/ps3/ohci_ps3.c b/sys/powerpc/ps3/ohci_ps3.c --- a/sys/powerpc/ps3/ohci_ps3.c +++ b/sys/powerpc/ps3/ohci_ps3.c @@ -157,11 +157,7 @@ DEVMETHOD_END }; -static driver_t ohci_ps3_driver = { - .name = "ohci", - .methods = ohci_ps3_methods, - .size = sizeof(ohci_softc_t), -}; +DEFINE_CLASS_0(ohci, ohci_ps3_driver, ohci_ps3_methods, sizeof(ohci_softc_t)); DRIVER_MODULE(ohci_ps3, ps3bus, ohci_ps3_driver, 0, 0); MODULE_DEPEND(ohci_ps3, usb, 1, 1, 1); diff --git a/sys/powerpc/ps3/ps3bus.c b/sys/powerpc/ps3/ps3bus.c --- a/sys/powerpc/ps3/ps3bus.c +++ b/sys/powerpc/ps3/ps3bus.c @@ -143,11 +143,8 @@ int rcount; }; -static driver_t ps3bus_driver = { - "ps3bus", - ps3bus_methods, - sizeof(struct ps3bus_softc) -}; +DEFINE_CLASS_0(ps3bus, ps3bus_driver, ps3bus_methods, + sizeof(struct ps3bus_softc)); DRIVER_MODULE(ps3bus, nexus, ps3bus_driver, 0, 0); diff --git a/sys/powerpc/ps3/ps3cdrom.c b/sys/powerpc/ps3/ps3cdrom.c --- a/sys/powerpc/ps3/ps3cdrom.c +++ b/sys/powerpc/ps3/ps3cdrom.c @@ -693,14 +693,12 @@ DEVMETHOD(device_probe, ps3cdrom_probe), DEVMETHOD(device_attach, ps3cdrom_attach), DEVMETHOD(device_detach, ps3cdrom_detach), - {0, 0}, -}; -static driver_t ps3cdrom_driver = { - "ps3cdrom", - ps3cdrom_methods, - sizeof(struct ps3cdrom_softc), + DEVMETHOD_END }; +DEFINE_CLASS_0(ps3cdrom, ps3cdrom_driver, ps3cdrom_methods, + sizeof(struct ps3cdrom_softc)); + DRIVER_MODULE(ps3cdrom, ps3bus, ps3cdrom_driver, 0, 0); MODULE_DEPEND(ps3cdrom, cam, 1, 1, 1); diff --git a/sys/powerpc/ps3/ps3disk.c b/sys/powerpc/ps3/ps3disk.c --- a/sys/powerpc/ps3/ps3disk.c +++ b/sys/powerpc/ps3/ps3disk.c @@ -686,13 +686,11 @@ DEVMETHOD(device_probe, ps3disk_probe), DEVMETHOD(device_attach, ps3disk_attach), DEVMETHOD(device_detach, ps3disk_detach), - {0, 0}, -}; -static driver_t ps3disk_driver = { - "ps3disk", - ps3disk_methods, - sizeof(struct ps3disk_softc), + DEVMETHOD_END }; +DEFINE_CLASS_0(ps3disk, ps3disk_driver, ps3disk_methods, + sizeof(struct ps3disk_softc)); + DRIVER_MODULE(ps3disk, ps3bus, ps3disk_driver, 0, 0); diff --git a/sys/powerpc/ps3/ps3pic.c b/sys/powerpc/ps3/ps3pic.c --- a/sys/powerpc/ps3/ps3pic.c +++ b/sys/powerpc/ps3/ps3pic.c @@ -80,14 +80,11 @@ DEVMETHOD(pic_mask, ps3pic_mask), DEVMETHOD(pic_unmask, ps3pic_unmask), - { 0, 0 }, + DEVMETHOD_END }; -static driver_t ps3pic_driver = { - "ps3pic", - ps3pic_methods, - sizeof(struct ps3pic_softc) -}; +DEFINE_CLASS_0(ps3pic, ps3pic_driver ps3pic_methods, + sizeof(struct ps3pic_softc)); DRIVER_MODULE(ps3pic, nexus, ps3pic_driver, 0, 0); diff --git a/sys/powerpc/pseries/phyp_console.c b/sys/powerpc/pseries/phyp_console.c --- a/sys/powerpc/pseries/phyp_console.c +++ b/sys/powerpc/pseries/phyp_console.c @@ -102,11 +102,8 @@ DEVMETHOD_END }; -static driver_t uart_phyp_driver = { - "uart", - uart_phyp_methods, - sizeof(struct uart_phyp_softc), -}; +DEFINE_CLASS_0(uart, uart_phyp_driver, uart_phyp_methods, + sizeof(struct uart_phyp_softc)); DRIVER_MODULE(uart_phyp, vdevice, uart_phyp_driver, 0, 0); diff --git a/sys/powerpc/pseries/phyp_llan.c b/sys/powerpc/pseries/phyp_llan.c --- a/sys/powerpc/pseries/phyp_llan.c +++ b/sys/powerpc/pseries/phyp_llan.c @@ -131,11 +131,7 @@ DEVMETHOD_END }; -static driver_t llan_driver = { - "llan", - llan_methods, - sizeof(struct llan_softc) -}; +DEFINE_CLASS_0(llan, llan_driver, llan_methods, sizeof(struct llan_softc)); DRIVER_MODULE(llan, vdevice, llan_driver, 0, 0); diff --git a/sys/powerpc/pseries/phyp_vscsi.c b/sys/powerpc/pseries/phyp_vscsi.c --- a/sys/powerpc/pseries/phyp_vscsi.c +++ b/sys/powerpc/pseries/phyp_vscsi.c @@ -255,11 +255,7 @@ DEVMETHOD_END }; -static driver_t vscsi_driver = { - "vscsi", - vscsi_methods, - sizeof(struct vscsi_softc) -}; +DEFINE_CLASS_0(vscsi, vscsi_driver, vscsi_methods, sizeof(struct vscsi_softc)); DRIVER_MODULE(vscsi, vdevice, vscsi_driver, 0, 0); MALLOC_DEFINE(M_VSCSI, "vscsi", "CAM device queue for VSCSI"); diff --git a/sys/powerpc/pseries/platform_chrp.c b/sys/powerpc/pseries/platform_chrp.c --- a/sys/powerpc/pseries/platform_chrp.c +++ b/sys/powerpc/pseries/platform_chrp.c @@ -108,7 +108,8 @@ #endif PLATFORMMETHOD(platform_reset, chrp_reset), - { 0, 0 } + + PLATFORMMETHOD_END }; static platform_def_t chrp_platform = { diff --git a/sys/powerpc/pseries/rtas_dev.c b/sys/powerpc/pseries/rtas_dev.c --- a/sys/powerpc/pseries/rtas_dev.c +++ b/sys/powerpc/pseries/rtas_dev.c @@ -62,14 +62,10 @@ DEVMETHOD(clock_gettime, rtas_gettime), DEVMETHOD(clock_settime, rtas_settime), - { 0, 0 }, + DEVMETHOD_END }; -static driver_t rtasdev_driver = { - "rtas", - rtasdev_methods, - 0 -}; +DEFINE_CLASS_0(rtas, rtasdev_driver, rtasdev_methods, 0); DRIVER_MODULE(rtasdev, ofwbus, rtasdev_driver, 0, 0); diff --git a/sys/powerpc/pseries/vdevice.c b/sys/powerpc/pseries/vdevice.c --- a/sys/powerpc/pseries/vdevice.c +++ b/sys/powerpc/pseries/vdevice.c @@ -94,11 +94,7 @@ DEVMETHOD_END }; -static driver_t vdevice_driver = { - "vdevice", - vdevice_methods, - 0 -}; +DEFINE_CLASS_0(vdevice, vdevice_driver, vdevice_methods, 0); DRIVER_MODULE(vdevice, ofwbus, vdevice_driver, 0, 0); diff --git a/sys/powerpc/pseries/xics.c b/sys/powerpc/pseries/xics.c --- a/sys/powerpc/pseries/xics.c +++ b/sys/powerpc/pseries/xics.c @@ -128,17 +128,9 @@ bool xics_emu; }; -static driver_t xicp_driver = { - "xicp", - xicp_methods, - sizeof(struct xicp_softc) -}; +DEFINE_CLASS_0(xicp, xicp_driver, xicp_methods, sizeof(struct xicp_softc)); -static driver_t xics_driver = { - "xics", - xics_methods, - 0 -}; +DEFINE_CLASS_0(xics, xics_driver, xics_methods, 0); #ifdef POWERNV /* We can only pass physical addresses into OPAL. Kernel stacks are in the KVA, diff --git a/sys/powerpc/psim/ata_iobus.c b/sys/powerpc/psim/ata_iobus.c --- a/sys/powerpc/psim/ata_iobus.c +++ b/sys/powerpc/psim/ata_iobus.c @@ -64,7 +64,7 @@ static int ata_iobus_release_resource(device_t, device_t, struct resource *); static device_method_t ata_iobus_methods[] = { - /* Device interface */ + /* Device interface */ DEVMETHOD(device_probe, ata_iobus_probe), DEVMETHOD(device_attach, ata_iobus_attach), DEVMETHOD(device_shutdown, bus_generic_shutdown), @@ -83,11 +83,7 @@ DEVMETHOD_END }; -static driver_t ata_iobus_driver = { - "ataiobus", - ata_iobus_methods, - 0, -}; +DEFINE_CLASS_0(ataiobus, ata_iobus_driver, ata_iobus_methods, 0); DRIVER_MODULE(ataiobus, iobus, ata_iobus_driver, NULL, NULL); MODULE_DEPEND(ata, ata, 1, 1, 1); @@ -217,11 +213,8 @@ DEVMETHOD_END }; -static driver_t ata_iobus_sub_driver = { - "ata", - ata_iobus_sub_methods, - sizeof(struct ata_channel), -}; +DEFINE_CLASS_0(ata, ata_iobus_sub_driver, ata_iobus_sub_methods, + sizeof(struct ata_channel)); DRIVER_MODULE(ata, ataiobus, ata_iobus_sub_driver, NULL, NULL); diff --git a/sys/powerpc/psim/iobus.c b/sys/powerpc/psim/iobus.c --- a/sys/powerpc/psim/iobus.c +++ b/sys/powerpc/psim/iobus.c @@ -89,39 +89,36 @@ * Bus interface definition */ static device_method_t iobus_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, iobus_probe), - DEVMETHOD(device_attach, iobus_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, iobus_print_child), - DEVMETHOD(bus_probe_nomatch, iobus_probe_nomatch), - DEVMETHOD(bus_read_ivar, iobus_read_ivar), - DEVMETHOD(bus_write_ivar, iobus_write_ivar), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + /* Device interface */ + DEVMETHOD(device_probe, iobus_probe), + DEVMETHOD(device_attach, iobus_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, iobus_print_child), + DEVMETHOD(bus_probe_nomatch, iobus_probe_nomatch), + DEVMETHOD(bus_read_ivar, iobus_read_ivar), + DEVMETHOD(bus_write_ivar, iobus_write_ivar), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_get_rman, iobus_get_rman), - DEVMETHOD(bus_alloc_resource, iobus_alloc_resource), + DEVMETHOD(bus_alloc_resource, iobus_alloc_resource), DEVMETHOD(bus_adjust_resource, iobus_adjust_resource), - DEVMETHOD(bus_release_resource, iobus_release_resource), - DEVMETHOD(bus_activate_resource, iobus_activate_resource), - DEVMETHOD(bus_deactivate_resource, iobus_deactivate_resource), + DEVMETHOD(bus_release_resource, iobus_release_resource), + DEVMETHOD(bus_activate_resource, iobus_activate_resource), + DEVMETHOD(bus_deactivate_resource, iobus_deactivate_resource), DEVMETHOD(bus_map_resource, iobus_map_resource), DEVMETHOD(bus_unmap_resource, iobus_unmap_resource), - { 0, 0 } -}; -static driver_t iobus_driver = { - "iobus", - iobus_methods, - sizeof(struct iobus_softc) + DEVMETHOD_END }; +DEFINE_CLASS_0(iobus, iobus_driver, iobus_methods, sizeof(struct iobus_softc)); + DRIVER_MODULE(iobus, ofwbus, iobus_driver, 0, 0); static int diff --git a/sys/powerpc/psim/openpic_iobus.c b/sys/powerpc/psim/openpic_iobus.c --- a/sys/powerpc/psim/openpic_iobus.c +++ b/sys/powerpc/psim/openpic_iobus.c @@ -77,15 +77,13 @@ DEVMETHOD(pic_ipi, openpic_ipi), DEVMETHOD(pic_mask, openpic_mask), DEVMETHOD(pic_unmask, openpic_unmask), - { 0, 0 } -}; -static driver_t openpic_iobus_driver = { - "openpic", - openpic_iobus_methods, - sizeof(struct openpic_softc) + DEVMETHOD_END }; +DEFINE_CLASS_0(openpic, openpic_iobus_driver, openpic_iobus_methods, + sizeof(struct openpic_softc)); + DRIVER_MODULE(openpic, iobus, openpic_iobus_driver, 0, 0); static int diff --git a/sys/powerpc/psim/uart_iobus.c b/sys/powerpc/psim/uart_iobus.c --- a/sys/powerpc/psim/uart_iobus.c +++ b/sys/powerpc/psim/uart_iobus.c @@ -52,11 +52,12 @@ static int uart_iobus_probe(device_t dev); static device_method_t uart_iobus_methods[] = { - /* Device interface */ + /* Device interface */ DEVMETHOD(device_probe, uart_iobus_probe), DEVMETHOD(device_attach, uart_bus_attach), DEVMETHOD(device_detach, uart_bus_detach), - { 0, 0 } + + DEVMETHOD_END }; static driver_t uart_iobus_driver = {