[PATCH 3/8 net-next] irda: mcp2120-sir: use module_sirdev_driver() helper

From: Fabian Frederick
Date: Wed Jul 13 2016 - 14:32:03 EST


Avoid using generic init/exit functions.

Signed-off-by: Fabian Frederick <fabf@xxxxxxxxx>
---
drivers/net/irda/mcp2120-sir.c | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/net/irda/mcp2120-sir.c b/drivers/net/irda/mcp2120-sir.c
index 2e33f91..015d434 100644
--- a/drivers/net/irda/mcp2120-sir.c
+++ b/drivers/net/irda/mcp2120-sir.c
@@ -49,16 +49,6 @@ static struct dongle_driver mcp2120 = {
.set_speed = mcp2120_change_speed,
};

-static int __init mcp2120_sir_init(void)
-{
- return irda_register_dongle(&mcp2120);
-}
-
-static void __exit mcp2120_sir_cleanup(void)
-{
- irda_unregister_dongle(&mcp2120);
-}
-
static int mcp2120_open(struct sir_dev *dev)
{
struct qos_info *qos = &dev->qos;
@@ -215,10 +205,9 @@ static int mcp2120_reset(struct sir_dev *dev)
return (delay > 0) ? delay : ret;
}

+module_sirdev_driver(mcp2120);
+
MODULE_AUTHOR("Felix Tang <tangf@xxxxxxxxxx>");
MODULE_DESCRIPTION("Microchip MCP2120");
MODULE_LICENSE("GPL");
MODULE_ALIAS("irda-dongle-9"); /* IRDA_MCP2120_DONGLE */
-
-module_init(mcp2120_sir_init);
-module_exit(mcp2120_sir_cleanup);
--
2.8.1