[PATCHv2 3/8] staging: comedi: das08: Use module_comedi_{pci_, }driver

H Hartley Sweeten hartleys at visionengravers.com
Thu May 24 16:36:46 UTC 2012


On Thursday, May 24, 2012 9:27 AM, Ian Abbott wrote:
> If PCI boards are supported, use the module_comedi_pci_driver() macro to
> register the module as a comedi driver and a PCI driver.  Otherwise, if
> ISA (or PC/104) boards are supported, use the module_comedi_driver()
> macro to register the module as a comedi driver.  Otherwise, this is
> only a helper module for an external comedi driver (das08_cs).
>
> Signed-off-by: Ian Abbott <abbotti at mev.co.uk>
> ---

<snip>

> +#else /* DO_COMEDI_DRIVER_REGISTER */
> +static int __init das08_init(void)
> +{
> +	return 0;
>  }
>  
> -static void __exit driver_das08_cleanup_module(void)
> +static void __exit das08_exit(void)
>  {
> -#if IS_ENABLED(CONFIG_COMEDI_DAS08_PCI)
> -	pci_unregister_driver(&driver_das08_pci_driver);
> -#endif
> -#ifdef DO_COMEDI_DRIVER_REGISTER
> -	comedi_driver_unregister(&driver_das08);
> -#endif
>  }
>  
> -module_init(driver_das08_init_module);
> -module_exit(driver_das08_cleanup_module);
> +module_init(das08_init);
> +module_exit(das08_exit);
> +#endif /* DO_COMEDI_DRIVER_REGISTER */

When this file is only compiled to be used as a helper library
are the module_init/module_exit stubs even needed?

Take a look at the drivers/gpio/gpio-generic.c driver for an
example.

Regards,
Hartley




More information about the devel mailing list