提交 9c8dc10f 编写于 作者: D Devendra Naga 提交者: Greg Kroah-Hartman

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: NDevendra Naga <develkernel412222@gmail.com>
Acked-by: NArnd Bergmann <arnd@arndb.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 7e0b2cde
...@@ -73,19 +73,8 @@ static struct spi_driver bmp085_spi_driver = { ...@@ -73,19 +73,8 @@ static struct spi_driver bmp085_spi_driver = {
.remove = __devexit_p(bmp085_spi_remove) .remove = __devexit_p(bmp085_spi_remove)
}; };
static int __init bmp085_spi_init(void) module_spi_driver(bmp085_spi_driver);
{
return spi_register_driver(&bmp085_spi_driver);
}
static void __exit bmp085_spi_exit(void)
{
spi_unregister_driver(&bmp085_spi_driver);
}
MODULE_AUTHOR("Eric Andersson <eric.andersson@unixphere.com>"); MODULE_AUTHOR("Eric Andersson <eric.andersson@unixphere.com>");
MODULE_DESCRIPTION("BMP085 SPI bus driver"); MODULE_DESCRIPTION("BMP085 SPI bus driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
module_init(bmp085_spi_init);
module_exit(bmp085_spi_exit);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册