[PATCH 12/19] ASoC: wm8753: Convert to module_i2c/spi_driver()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>

Let's use module_i2c/spi_driver()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
---
 sound/soc/codecs/wm8753.c | 34 ++--------------------------------
 1 file changed, 2 insertions(+), 32 deletions(-)

diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c
index 9bdf544..9eb8eb4c 100644
--- a/sound/soc/codecs/wm8753.c
+++ b/sound/soc/codecs/wm8753.c
@@ -1555,6 +1555,7 @@ static int wm8753_spi_remove(struct spi_device *spi)
 	.probe		= wm8753_spi_probe,
 	.remove		= wm8753_spi_remove,
 };
+module_spi_driver(wm8753_spi_driver);
 #endif /* CONFIG_SPI_MASTER */
 
 #if IS_ENABLED(CONFIG_I2C)
@@ -1608,40 +1609,9 @@ static int wm8753_i2c_remove(struct i2c_client *client)
 	.remove =   wm8753_i2c_remove,
 	.id_table = wm8753_i2c_id,
 };
+module_i2c_driver(wm8753_i2c_driver);
 #endif
 
-static int __init wm8753_modinit(void)
-{
-	int ret = 0;
-#if IS_ENABLED(CONFIG_I2C)
-	ret = i2c_add_driver(&wm8753_i2c_driver);
-	if (ret != 0) {
-		printk(KERN_ERR "Failed to register wm8753 I2C driver: %d\n",
-		       ret);
-	}
-#endif
-#if defined(CONFIG_SPI_MASTER)
-	ret = spi_register_driver(&wm8753_spi_driver);
-	if (ret != 0) {
-		printk(KERN_ERR "Failed to register wm8753 SPI driver: %d\n",
-		       ret);
-	}
-#endif
-	return ret;
-}
-module_init(wm8753_modinit);
-
-static void __exit wm8753_exit(void)
-{
-#if IS_ENABLED(CONFIG_I2C)
-	i2c_del_driver(&wm8753_i2c_driver);
-#endif
-#if defined(CONFIG_SPI_MASTER)
-	spi_unregister_driver(&wm8753_spi_driver);
-#endif
-}
-module_exit(wm8753_exit);
-
 MODULE_DESCRIPTION("ASoC WM8753 driver");
 MODULE_AUTHOR("Liam Girdwood");
 MODULE_LICENSE("GPL");
-- 
1.9.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux