staging: comedi: use module_comedi_driver
authorH Hartley Sweeten <hartleys@visionengravers.com>
Thu, 3 May 2012 22:09:40 +0000 (15:09 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 May 2012 20:31:36 +0000 (13:31 -0700)
Convert the refactored comedi drivers to use the module_comedi_driver()
macro which makes the code smaller and a bit simpler.

In the process, rename the driver variables from driver_* to *_driver,
as is more typical with other subsystems, and make sure they are all
static.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Mori Hess <fmhess@users.sourceforge.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
28 files changed:
drivers/staging/comedi/drivers/8255.c
drivers/staging/comedi/drivers/acl7225b.c
drivers/staging/comedi/drivers/adq12b.c
drivers/staging/comedi/drivers/aio_aio12_8.c
drivers/staging/comedi/drivers/aio_iiro_16.c
drivers/staging/comedi/drivers/c6xdigio.c
drivers/staging/comedi/drivers/dt2815.c
drivers/staging/comedi/drivers/dt2817.c
drivers/staging/comedi/drivers/fl512.c
drivers/staging/comedi/drivers/pcl711.c
drivers/staging/comedi/drivers/pcl724.c
drivers/staging/comedi/drivers/pcl725.c
drivers/staging/comedi/drivers/pcl726.c
drivers/staging/comedi/drivers/pcl730.c
drivers/staging/comedi/drivers/pcl812.c
drivers/staging/comedi/drivers/pcl816.c
drivers/staging/comedi/drivers/pcl818.c
drivers/staging/comedi/drivers/pcm3724.c
drivers/staging/comedi/drivers/pcm3730.c
drivers/staging/comedi/drivers/pcmad.c
drivers/staging/comedi/drivers/pcmda12.c
drivers/staging/comedi/drivers/pcmmio.c
drivers/staging/comedi/drivers/pcmuio.c
drivers/staging/comedi/drivers/poc.c
drivers/staging/comedi/drivers/rti800.c
drivers/staging/comedi/drivers/rti802.c
drivers/staging/comedi/drivers/s526.c
drivers/staging/comedi/drivers/serial2002.c

index ed803976b74172c72dd1cee1abaa8fa74dc9833f..f709107e1a37d92c7a60b5867f1d529eedbba455 100644 (file)
@@ -437,24 +437,13 @@ static int dev_8255_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver driver_8255 = {
+static struct comedi_driver dev_8255_driver = {
        .driver_name    = "8255",
        .module         = THIS_MODULE,
        .attach         = dev_8255_attach,
        .detach         = dev_8255_detach,
 };
-
-static int __init driver_8255_init_module(void)
-{
-       return comedi_driver_register(&driver_8255);
-}
-module_init(driver_8255_init_module);
-
-static void __exit driver_8255_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_8255);
-}
-module_exit(driver_8255_cleanup_module);
+module_comedi_driver(dev_8255_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index ef685fc49b45610818e611f0ad96f4617765dee3..e5f8729e08538f572f8308501c3d43c63cc747c2 100644 (file)
@@ -134,7 +134,7 @@ static const struct boardtype boardtypes[] = {
        { "p16r16dio", P16R16DIO_SIZE, },
 };
 
-static struct comedi_driver driver_acl7225b = {
+static struct comedi_driver acl7225b_driver = {
        .driver_name    = "acl7225b",
        .module         = THIS_MODULE,
        .attach         = acl7225b_attach,
@@ -143,18 +143,7 @@ static struct comedi_driver driver_acl7225b = {
        .num_names      = ARRAY_SIZE(boardtypes),
        .offset         = sizeof(struct boardtype),
 };
-
-static int __init driver_acl7225b_init_module(void)
-{
-       return comedi_driver_register(&driver_acl7225b);
-}
-module_init(driver_acl7225b_init_module);
-
-static void __exit driver_acl7225b_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_acl7225b);
-}
-module_exit(driver_acl7225b_cleanup_module);
+module_comedi_driver(acl7225b_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 275cb771f776603fdaba1bb1638c7ed38b7d3184..6a68d5303a185ad23312627d5d83ee14e9880c2e 100644 (file)
@@ -347,7 +347,7 @@ static const struct adq12b_board adq12b_boards[] = {
        },
 };
 
-static struct comedi_driver driver_adq12b = {
+static struct comedi_driver adq12b_driver = {
        .driver_name    = "adq12b",
        .module         = THIS_MODULE,
        .attach         = adq12b_attach,
@@ -356,18 +356,7 @@ static struct comedi_driver driver_adq12b = {
        .offset         = sizeof(struct adq12b_board),
        .num_names      = ARRAY_SIZE(adq12b_boards),
 };
-
-static int __init driver_adq12b_init_module(void)
-{
-       return comedi_driver_register(&driver_adq12b);
-}
-module_init(driver_adq12b_init_module);
-
-static void __exit driver_adq12b_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_adq12b);
-}
-module_exit(driver_adq12b_cleanup_module);
+module_comedi_driver(adq12b_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index b0f98e5e4bf345be96d30375a7f5b2f76e9f216a..1a28e67b366d981a0ebf64ae3e347093aee2ffa4 100644 (file)
@@ -217,28 +217,16 @@ static int aio_aio12_8_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver driver_aio_aio12_8 = {
-       .driver_name = "aio_aio12_8",
-       .module = THIS_MODULE,
-       .attach = aio_aio12_8_attach,
-       .detach = aio_aio12_8_detach,
-       .board_name = &board_types[0].name,
-       .num_names = 1,
-       .offset = sizeof(struct aio12_8_boardtype),
+static struct comedi_driver aio_aio12_8_driver = {
+       .driver_name    = "aio_aio12_8",
+       .module         = THIS_MODULE,
+       .attach         = aio_aio12_8_attach,
+       .detach         = aio_aio12_8_detach,
+       .board_name     = &board_types[0].name,
+       .num_names      = ARRAY_SIZE(board_types),
+       .offset         = sizeof(struct aio12_8_boardtype),
 };
-
-static int __init driver_aio_aio12_8_init_module(void)
-{
-       return comedi_driver_register(&driver_aio_aio12_8);
-}
-
-static void __exit driver_aio_aio12_8_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_aio_aio12_8);
-}
-
-module_init(driver_aio_aio12_8_init_module);
-module_exit(driver_aio_aio12_8_cleanup_module);
+module_comedi_driver(aio_aio12_8_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 763461a569aa6ea170ed0fb6a8c3b3261d6bca50..242255c45f3198bb7c853a84711d547cd635468e 100644 (file)
@@ -159,7 +159,7 @@ static int aio_iiro_16_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver driver_aio_iiro_16 = {
+static struct comedi_driver aio_iiro_16_driver = {
        .driver_name    = "aio_iiro_16",
        .module         = THIS_MODULE,
        .attach         = aio_iiro_16_attach,
@@ -168,18 +168,7 @@ static struct comedi_driver driver_aio_iiro_16 = {
        .offset         = sizeof(struct aio_iiro_16_board),
        .num_names      = ARRAY_SIZE(aio_iiro_16_boards),
 };
-
-static int __init driver_aio_iiro_16_init_module(void)
-{
-       return comedi_driver_register(&driver_aio_iiro_16);
-}
-module_init(driver_aio_iiro_16_init_module);
-
-static void __exit driver_aio_iiro_16_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_aio_iiro_16);
-}
-module_exit(driver_aio_iiro_16_cleanup_module);
+module_comedi_driver(aio_iiro_16_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 5f75351503971ab020e60467561f4039fc0ea6eb..56dd33ae0d5b0375ab9df70529647da377098fa7 100644 (file)
@@ -508,24 +508,13 @@ static int c6xdigio_detach(struct comedi_device *dev)
        return 0;
 }
 
-struct comedi_driver driver_c6xdigio = {
+static struct comedi_driver c6xdigio_driver = {
        .driver_name    = "c6xdigio",
        .module         = THIS_MODULE,
        .attach         = c6xdigio_attach,
        .detach         = c6xdigio_detach,
 };
-
-static int __init driver_c6xdigio_init_module(void)
-{
-       return comedi_driver_register(&driver_c6xdigio);
-}
-module_init(driver_c6xdigio_init_module);
-
-static void __exit driver_c6xdigio_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_c6xdigio);
-}
-module_exit(driver_c6xdigio_cleanup_module);
+module_comedi_driver(c6xdigio_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index f5a0dc501c6b97df9dbd87ac87534b95aef0d85f..152959c9640868ef5bcd95f55a32f5d236e87655 100644 (file)
@@ -242,24 +242,13 @@ static int dt2815_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver driver_dt2815 = {
+static struct comedi_driver dt2815_driver = {
        .driver_name    = "dt2815",
        .module         = THIS_MODULE,
        .attach         = dt2815_attach,
        .detach         = dt2815_detach,
 };
-
-static int __init driver_dt2815_init_module(void)
-{
-       return comedi_driver_register(&driver_dt2815);
-}
-module_init(driver_dt2815_init_module);
-
-static void __exit driver_dt2815_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_dt2815);
-}
-module_exit(driver_dt2815_cleanup_module);
+module_comedi_driver(dt2815_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 45d9a8296203174f943187b19bab904123e74500..d8149f4bf00887d3c316dd1c430701f99e2bd4f1 100644 (file)
@@ -169,24 +169,13 @@ static int dt2817_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver driver_dt2817 = {
+static struct comedi_driver dt2817_driver = {
        .driver_name    = "dt2817",
        .module         = THIS_MODULE,
        .attach         = dt2817_attach,
        .detach         = dt2817_detach,
 };
-
-static int __init driver_dt2817_init_module(void)
-{
-       return comedi_driver_register(&driver_dt2817);
-}
-module_init(driver_dt2817_init_module);
-
-static void __exit driver_dt2817_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_dt2817);
-}
-module_exit(driver_dt2817_cleanup_module);
+module_comedi_driver(dt2817_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 88c18ea36e12802be9068430cf002de8c86e1b6b..25fed75b08b71794b9e31fe681c30a91d42dbb7f 100644 (file)
@@ -182,24 +182,13 @@ static int fl512_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver driver_fl512 = {
+static struct comedi_driver fl512_driver = {
        .driver_name    = "fl512",
        .module         = THIS_MODULE,
        .attach         = fl512_attach,
        .detach         = fl512_detach,
 };
-
-static int __init driver_fl512_init_module(void)
-{
-       return comedi_driver_register(&driver_fl512);
-}
-module_init(driver_fl512_init_module);
-
-static void __exit driver_fl512_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_fl512);
-}
-module_exit(driver_fl512_cleanup_module);
+module_comedi_driver(fl512_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index fcb7cea761ac36af9b0049995257161b8196c2ab..6a12dca3df8d170cc406aa74a14b90a56b88ca22 100644 (file)
@@ -611,7 +611,7 @@ static const struct pcl711_board boardtypes[] = {
        { "acl8112dg", 0, 1, 1, 9, 16, 2, 15, &range_acl8112dg_ai },
 };
 
-static struct comedi_driver driver_pcl711 = {
+static struct comedi_driver pcl711_driver = {
        .driver_name    = "pcl711",
        .module         = THIS_MODULE,
        .attach         = pcl711_attach,
@@ -620,18 +620,7 @@ static struct comedi_driver driver_pcl711 = {
        .num_names      = ARRAY_SIZE(boardtypes),
        .offset         = sizeof(struct pcl711_board),
 };
-
-static int __init driver_pcl711_init_module(void)
-{
-       return comedi_driver_register(&driver_pcl711);
-}
-module_init(driver_pcl711_init_module);
-
-static void __exit driver_pcl711_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_pcl711);
-}
-module_exit(driver_pcl711_cleanup_module);
+module_comedi_driver(pcl711_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 7d0a306ccaaef53e1e57e819d7ba9e154b2d2ba7..75628586cdbf1834918d60dab2473403d0ad0340 100644 (file)
@@ -205,7 +205,7 @@ static const struct pcl724_board boardtypes[] = {
        { "pet48dio", 48, 2, 0x9eb8, PET48_SIZE, 0, 1, },
 };
 
-static struct comedi_driver driver_pcl724 = {
+static struct comedi_driver pcl724_driver = {
        .driver_name    = "pcl724",
        .module         = THIS_MODULE,
        .attach         = pcl724_attach,
@@ -214,18 +214,7 @@ static struct comedi_driver driver_pcl724 = {
        .num_names      = ARRAY_SIZE(boardtypes),
        .offset         = sizeof(struct pcl724_board),
 };
-
-static int __init driver_pcl724_init_module(void)
-{
-       return comedi_driver_register(&driver_pcl724);
-}
-module_init(driver_pcl724_init_module);
-
-static void __exit driver_pcl724_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_pcl724);
-}
-module_exit(driver_pcl724_cleanup_module);
+module_comedi_driver(pcl724_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 4b761a67ac1c79c6da54e6a38e98d506662f63c3..eeac943fddf0caa7a429372bf03c5f28d1d7190b 100644 (file)
@@ -99,24 +99,13 @@ static int pcl725_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver driver_pcl725 = {
+static struct comedi_driver pcl725_driver = {
        .driver_name    = "pcl725",
        .module         = THIS_MODULE,
        .attach         = pcl725_attach,
        .detach         = pcl725_detach,
 };
-
-static int __init driver_pcl725_init_module(void)
-{
-       return comedi_driver_register(&driver_pcl725);
-}
-module_init(driver_pcl725_init_module);
-
-static void __exit driver_pcl725_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_pcl725);
-}
-module_exit(driver_pcl725_cleanup_module);
+module_comedi_driver(pcl725_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index c63e91c2bca38b47ee2129d39df256a94d4ba892..8e2fb366d2ebc6b643cbd6ca1afdaec8d48e85ae 100644 (file)
@@ -365,7 +365,7 @@ static int pcl726_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver driver_pcl726 = {
+static struct comedi_driver pcl726_driver = {
        .driver_name    = "pcl726",
        .module         = THIS_MODULE,
        .attach         = pcl726_attach,
@@ -374,18 +374,7 @@ static struct comedi_driver driver_pcl726 = {
        .num_names      = ARRAY_SIZE(boardtypes),
        .offset         = sizeof(struct pcl726_board),
 };
-
-static int __init driver_pcl726_init_module(void)
-{
-       return comedi_driver_register(&driver_pcl726);
-}
-module_init(driver_pcl726_init_module);
-
-static void __exit driver_pcl726_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_pcl726);
-}
-module_exit(driver_pcl726_cleanup_module);
+module_comedi_driver(pcl726_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index f6fa8aeab9183697e9551a88742f62a688ae260a..73b4394fe478fd1a37c349741a7e0117e6594ee4 100644 (file)
@@ -150,7 +150,7 @@ static const struct pcl730_board boardtypes[] = {
        { "acl7130", ACL7130_SIZE, },
 };
 
-static struct comedi_driver driver_pcl730 = {
+static struct comedi_driver pcl730_driver = {
        .driver_name    = "pcl730",
        .module         = THIS_MODULE,
        .attach         = pcl730_attach,
@@ -159,18 +159,7 @@ static struct comedi_driver driver_pcl730 = {
        .num_names      = ARRAY_SIZE(boardtypes),
        .offset         = sizeof(struct pcl730_board),
 };
-
-static int __init driver_pcl730_init_module(void)
-{
-       return comedi_driver_register(&driver_pcl730);
-}
-module_init(driver_pcl730_init_module);
-
-static void __exit driver_pcl730_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_pcl730);
-}
-module_exit(driver_pcl730_cleanup_module);
+module_comedi_driver(pcl730_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 85463e275e598b90c0cb8d76e630b426ebe38152..613b397ea0469a757c92f51f2a55bdefbed10ef3 100644 (file)
@@ -1681,7 +1681,7 @@ static const struct pcl812_board boardtypes[] = {
         0xdcfc, 0x0a, PCLx1x_IORANGE, 0},
 };
 
-static struct comedi_driver driver_pcl812 = {
+static struct comedi_driver pcl812_driver = {
        .driver_name    = "pcl812",
        .module         = THIS_MODULE,
        .attach         = pcl812_attach,
@@ -1690,18 +1690,7 @@ static struct comedi_driver driver_pcl812 = {
        .num_names      = ARRAY_SIZE(boardtypes),
        .offset         = sizeof(struct pcl812_board),
 };
-
-static int __init driver_pcl812_init_module(void)
-{
-       return comedi_driver_register(&driver_pcl812);
-}
-module_init(driver_pcl812_init_module);
-
-static void __exit driver_pcl812_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_pcl812);
-}
-module_exit(driver_pcl812_cleanup_module);
+module_comedi_driver(pcl812_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index bccbb236d37d71ab762fc8cc47b62a9eb3781894..1559c05b8f140c35d0ca8f350a0dde70dc192ec4 100644 (file)
@@ -1317,7 +1317,7 @@ static const struct pcl816_board boardtypes[] = {
         100},
 };
 
-static struct comedi_driver driver_pcl816 = {
+static struct comedi_driver pcl816_driver = {
        .driver_name    = "pcl816",
        .module         = THIS_MODULE,
        .attach         = pcl816_attach,
@@ -1326,18 +1326,7 @@ static struct comedi_driver driver_pcl816 = {
        .num_names      = ARRAY_SIZE(boardtypes),
        .offset         = sizeof(struct pcl816_board),
 };
-
-static int __init driver_pcl816_init_module(void)
-{
-       return comedi_driver_register(&driver_pcl816);
-}
-module_init(driver_pcl816_init_module);
-
-static void __exit driver_pcl816_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_pcl816);
-}
-module_exit(driver_pcl816_cleanup_module);
+module_comedi_driver(pcl816_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 8dbefc51b2fc6aa06dfaa599c04a31f898e4e108..9b8a1ff5c8a48c2595b1e811fe635185b40a7140 100644 (file)
@@ -1992,7 +1992,7 @@ static const struct pcl818_board boardtypes[] = {
         0x0a, 0xfff, 0xfff, 0, 1 /* XXX ? */ },
 };
 
-static struct comedi_driver driver_pcl818 = {
+static struct comedi_driver pcl818_driver = {
        .driver_name    = "pcl818",
        .module         = THIS_MODULE,
        .attach         = pcl818_attach,
@@ -2001,18 +2001,7 @@ static struct comedi_driver driver_pcl818 = {
        .num_names      = ARRAY_SIZE(boardtypes),
        .offset         = sizeof(struct pcl818_board),
 };
-
-static int __init driver_pcl818_init_module(void)
-{
-       return comedi_driver_register(&driver_pcl818);
-}
-module_init(driver_pcl818_init_module);
-
-static void __exit driver_pcl818_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_pcl818);
-}
-module_exit(driver_pcl818_cleanup_module);
+module_comedi_driver(pcl818_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 88a354b6c0b555385e7680571bf10499940cb068..36c04597dae85029bc1782a4fbdc2398bb0ecabc 100644 (file)
@@ -291,7 +291,7 @@ static const struct pcm3724_board boardtypes[] = {
        { "pcm3724", 48, 2, 0x00fc, PCM3724_SIZE, },
 };
 
-static struct comedi_driver driver_pcm3724 = {
+static struct comedi_driver pcm3724_driver = {
        .driver_name    = "pcm3724",
        .module         = THIS_MODULE,
        .attach         = pcm3724_attach,
@@ -300,18 +300,7 @@ static struct comedi_driver driver_pcm3724 = {
        .num_names      = ARRAY_SIZE(boardtypes),
        .offset         = sizeof(struct pcm3724_board),
 };
-
-static int __init driver_pcm3724_init_module(void)
-{
-       return comedi_driver_register(&driver_pcm3724);
-}
-module_init(driver_pcm3724_init_module);
-
-static void __exit driver_pcm3724_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_pcm3724);
-}
-module_exit(driver_pcm3724_cleanup_module);
+module_comedi_driver(pcm3724_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 342899348370e8eaa3d34f52d008ef401b25424c..1571b8357ed7b6ea12e4f0e1860833a0a3ca8649 100644 (file)
@@ -143,24 +143,13 @@ static int pcm3730_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver driver_pcm3730 = {
+static struct comedi_driver pcm3730_driver = {
        .driver_name    = "pcm3730",
        .module         = THIS_MODULE,
        .attach         = pcm3730_attach,
        .detach         = pcm3730_detach,
 };
-
-static int __init driver_pcm3730_init_module(void)
-{
-       return comedi_driver_register(&driver_pcm3730);
-}
-module_init(driver_pcm3730_init_module);
-
-static void __exit driver_pcm3730_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_pcm3730);
-}
-module_exit(driver_pcm3730_cleanup_module);
+module_comedi_driver(pcm3730_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index fe8ef664c1f41e525937f421979c1927cfb53985..05a2363a55bf03d827f54052048d33d8542b934e 100644 (file)
@@ -161,7 +161,7 @@ static const struct pcmad_board_struct pcmad_boards[] = {
                .n_ai_bits      = 16,
        },
 };
-static struct comedi_driver driver_pcmad = {
+static struct comedi_driver pcmad_driver = {
        .driver_name    = "pcmad",
        .module         = THIS_MODULE,
        .attach         = pcmad_attach,
@@ -170,18 +170,7 @@ static struct comedi_driver driver_pcmad = {
        .num_names      = ARRAY_SIZE(pcmad_boards),
        .offset         = sizeof(pcmad_boards[0]),
 };
-
-static int __init driver_pcmad_init_module(void)
-{
-       return comedi_driver_register(&driver_pcmad);
-}
-module_init(driver_pcmad_init_module);
-
-static void __exit driver_pcmad_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_pcmad);
-}
-module_exit(driver_pcmad_cleanup_module);
+module_comedi_driver(pcmad_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index a82b343755fc915eb0f3248715bb5baae71b8565..aaea0e600108ef5c6001405d1059f5f718e740fd 100644 (file)
@@ -242,7 +242,7 @@ static const struct pcmda12_board pcmda12_boards[] = {
        },
 };
 
-static struct comedi_driver driver = {
+static struct comedi_driver pcmda12_driver = {
        .driver_name    = "pcmda12",
        .module         = THIS_MODULE,
        .attach         = pcmda12_attach,
@@ -251,18 +251,7 @@ static struct comedi_driver driver = {
        .offset         = sizeof(struct pcmda12_board),
        .num_names      = ARRAY_SIZE(pcmda12_boards),
 };
-
-static int __init driver_init_module(void)
-{
-       return comedi_driver_register(&driver);
-}
-module_init(driver_init_module);
-
-static void __exit driver_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver);
-}
-module_exit(driver_cleanup_module);
+module_comedi_driver(pcmda12_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 9ee1da531b61577a8971d4a16e135de789cd45ec..a977acbf94161d3170597a357612e3975571d346 100644 (file)
@@ -1261,7 +1261,7 @@ static const struct pcmmio_board pcmmio_boards[] = {
        },
 };
 
-static struct comedi_driver driver = {
+static struct comedi_driver pcmmio_driver = {
        .driver_name    = "pcmmio",
        .module         = THIS_MODULE,
        .attach         = pcmmio_attach,
@@ -1270,18 +1270,7 @@ static struct comedi_driver driver = {
        .offset         = sizeof(struct pcmmio_board),
        .num_names      = ARRAY_SIZE(pcmmio_boards),
 };
-
-static int __init driver_init_module(void)
-{
-       return comedi_driver_register(&driver);
-}
-module_init(driver_init_module);
-
-static void __exit driver_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver);
-}
-module_exit(driver_cleanup_module);
+module_comedi_driver(pcmmio_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 47a3ee6e405c49e87947e421628eb6bd1f628209..b18912ac8e2156781e502a3762a30dac055ce400 100644 (file)
@@ -940,7 +940,7 @@ static const struct pcmuio_board pcmuio_boards[] = {
        },
 };
 
-static struct comedi_driver driver = {
+static struct comedi_driver pcmuio_driver = {
        .driver_name    = "pcmuio",
        .module         = THIS_MODULE,
        .attach         = pcmuio_attach,
@@ -949,18 +949,7 @@ static struct comedi_driver driver = {
        .offset         = sizeof(struct pcmuio_board),
        .num_names      = ARRAY_SIZE(pcmuio_boards),
 };
-
-static int __init driver_init_module(void)
-{
-       return comedi_driver_register(&driver);
-}
-module_init(driver_init_module);
-
-static void __exit driver_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver);
-}
-module_exit(driver_cleanup_module);
+module_comedi_driver(pcmuio_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index e3690bbd201a5675dd1fa51e8b0f1965840008d5..2e50c7fd788222fbdbe20037a42a99e899e7300c 100644 (file)
@@ -222,7 +222,7 @@ static const struct boarddef_struct boards[] = {
        },
 };
 
-static struct comedi_driver driver_poc = {
+static struct comedi_driver poc_driver = {
        .driver_name    = "poc",
        .module         = THIS_MODULE,
        .attach         = poc_attach,
@@ -231,18 +231,7 @@ static struct comedi_driver driver_poc = {
        .num_names      = ARRAY_SIZE(boards),
        .offset         = sizeof(boards[0]),
 };
-
-static int __init driver_poc_init_module(void)
-{
-       return comedi_driver_register(&driver_poc);
-}
-module_init(driver_poc_init_module);
-
-static void __exit driver_poc_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_poc);
-}
-module_exit(driver_poc_cleanup_module);
+module_comedi_driver(poc_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 9e082b3f969f4887a50dd2e0c2532479c8210c61..c073bf46f62f016c5b0ae33ec54e29a704c62052 100644 (file)
@@ -461,7 +461,7 @@ static const struct rti800_board boardtypes[] = {
        { "rti815", 1 },
 };
 
-static struct comedi_driver driver_rti800 = {
+static struct comedi_driver rti800_driver = {
        .driver_name    = "rti800",
        .module         = THIS_MODULE,
        .attach         = rti800_attach,
@@ -470,18 +470,7 @@ static struct comedi_driver driver_rti800 = {
        .board_name     = &boardtypes[0].name,
        .offset         = sizeof(struct rti800_board),
 };
-
-static int __init driver_rti800_init_module(void)
-{
-       return comedi_driver_register(&driver_rti800);
-}
-module_init(driver_rti800_init_module);
-
-static void __exit driver_rti800_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_rti800);
-}
-module_exit(driver_rti800_cleanup_module);
+module_comedi_driver(rti800_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index 21baf1a1c4058b7f03f5eac65c85f59ef83064c5..b4980b41596fc65bf032dfaa6ff4ef19a0dc5c87 100644 (file)
@@ -139,24 +139,13 @@ static int rti802_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver driver_rti802 = {
+static struct comedi_driver rti802_driver = {
        .driver_name    = "rti802",
        .module         = THIS_MODULE,
        .attach         = rti802_attach,
        .detach         = rti802_detach,
 };
-
-static int __init driver_rti802_init_module(void)
-{
-       return comedi_driver_register(&driver_rti802);
-}
-module_init(driver_rti802_init_module);
-
-static void __exit driver_rti802_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_rti802);
-}
-module_exit(driver_rti802_cleanup_module);
+module_comedi_driver(rti802_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index ffe4362819e2b401a4ba125344f4bf43fd57af56..3f86ed781d72e21c402eaf41d08de0829fe3fd7b 100644 (file)
@@ -948,7 +948,7 @@ static int s526_detach(struct comedi_device *dev)
        return 0;
 }
 
-static struct comedi_driver driver_s526 = {
+static struct comedi_driver s526_driver = {
        .driver_name    = "s526",
        .module         = THIS_MODULE,
        .attach         = s526_attach,
@@ -957,18 +957,7 @@ static struct comedi_driver driver_s526 = {
        .offset         = sizeof(struct s526_board),
        .num_names      = ARRAY_SIZE(s526_boards),
 };
-
-static int __init driver_s526_init_module(void)
-{
-       return comedi_driver_register(&driver_s526);
-}
-module_init(driver_s526_init_module);
-
-static void __exit driver_s526_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_s526);
-}
-module_exit(driver_s526_cleanup_module);
+module_comedi_driver(s526_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");
index a034b10b4fab61cc7e30571dcc177da132e84c9b..0fbd9f93ab0beaff06923461d8f1ed09c63ac11c 100644 (file)
@@ -868,7 +868,7 @@ static const struct serial2002_board serial2002_boards[] = {
        },
 };
 
-struct comedi_driver driver_serial2002 = {
+static struct comedi_driver serial2002_driver = {
        .driver_name    = "serial2002",
        .module         = THIS_MODULE,
        .attach         = serial2002_attach,
@@ -877,18 +877,7 @@ struct comedi_driver driver_serial2002 = {
        .offset         = sizeof(struct serial2002_board),
        .num_names      = ARRAY_SIZE(serial2002_boards),
 };
-
-static int __init driver_serial2002_init_module(void)
-{
-       return comedi_driver_register(&driver_serial2002);
-}
-module_init(driver_serial2002_init_module);
-
-static void __exit driver_serial2002_cleanup_module(void)
-{
-       comedi_driver_unregister(&driver_serial2002);
-}
-module_exit(driver_serial2002_cleanup_module);
+module_comedi_driver(serial2002_driver);
 
 MODULE_AUTHOR("Comedi http://www.comedi.org");
 MODULE_DESCRIPTION("Comedi low-level driver");