From: Devendra Naga Date: Thu, 23 Aug 2012 08:53:09 +0000 (+0530) Subject: misc: use module_spi_driver X-Git-Tag: v3.7-rc1~175^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9c8dc10f487dde5b114a53c73a36b3bc4459e213;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git misc: use module_spi_driver The _init and _exit functions can be replaced with the module_spi_driver macro, which actually implements static int __init drv_init(void) { spi_register_driver(&driv_op); return 0; } module_init(drv_init); static void __exit drv_exit(void) { spi_unregister_driver(&driv_op); } module_exit(drv_exit); Signed-off-by: Devendra Naga Acked-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/misc/bmp085-spi.c b/drivers/misc/bmp085-spi.c index 78aaff9..5e982af 100644 --- a/drivers/misc/bmp085-spi.c +++ b/drivers/misc/bmp085-spi.c @@ -73,19 +73,8 @@ static struct spi_driver bmp085_spi_driver = { .remove = __devexit_p(bmp085_spi_remove) }; -static int __init bmp085_spi_init(void) -{ - return spi_register_driver(&bmp085_spi_driver); -} - -static void __exit bmp085_spi_exit(void) -{ - spi_unregister_driver(&bmp085_spi_driver); -} +module_spi_driver(bmp085_spi_driver); MODULE_AUTHOR("Eric Andersson "); MODULE_DESCRIPTION("BMP085 SPI bus driver"); MODULE_LICENSE("GPL"); - -module_init(bmp085_spi_init); -module_exit(bmp085_spi_exit);