From 234d4d6b1038f004f233f14906ec9328bf53088b Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Tue, 18 Dec 2012 16:40:16 +0100 Subject: [PATCH] NFC: pn544: Use module_i2c_driver The pn544 init routine does nothing but adding the driver to the i2c bus. Signed-off-by: Samuel Ortiz --- drivers/nfc/pn544/i2c.c | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c index 7da9071b68b6..ec79f355edc1 100644 --- a/drivers/nfc/pn544/i2c.c +++ b/drivers/nfc/pn544/i2c.c @@ -472,29 +472,7 @@ static struct i2c_driver pn544_hci_i2c_driver = { .remove = __devexit_p(pn544_hci_i2c_remove), }; -static int __init pn544_hci_i2c_init(void) -{ - int r; - - pr_debug(DRIVER_DESC ": %s\n", __func__); - - r = i2c_add_driver(&pn544_hci_i2c_driver); - if (r) { - pr_err(PN544_HCI_I2C_DRIVER_NAME - ": driver registration failed\n"); - return r; - } - - return 0; -} - -static void __exit pn544_hci_i2c_exit(void) -{ - i2c_del_driver(&pn544_hci_i2c_driver); -} - -module_init(pn544_hci_i2c_init); -module_exit(pn544_hci_i2c_exit); +module_i2c_driver(pn544_hci_i2c_driver); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION(DRIVER_DESC); -- 2.20.1