From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
Let's use module_i2c/spi_driver()
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/codecs/wm8711.c | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-)
diff --git a/sound/soc/codecs/wm8711.c b/sound/soc/codecs/wm8711.c index 2b376c9..edcc45d 100644 --- a/sound/soc/codecs/wm8711.c +++ b/sound/soc/codecs/wm8711.c @@ -438,6 +438,7 @@ static int wm8711_spi_remove(struct spi_device *spi) .probe = wm8711_spi_probe, .remove = wm8711_spi_remove, }; +module_spi_driver(wm8711_spi_driver); #endif /* CONFIG_SPI_MASTER */
#if IS_ENABLED(CONFIG_I2C) @@ -485,40 +486,9 @@ static int wm8711_i2c_remove(struct i2c_client *client) .remove = wm8711_i2c_remove, .id_table = wm8711_i2c_id, }; +module_i2c_driver(wm8711_i2c_driver); #endif
-static int __init wm8711_modinit(void) -{ - int ret; -#if IS_ENABLED(CONFIG_I2C) - ret = i2c_add_driver(&wm8711_i2c_driver); - if (ret != 0) { - printk(KERN_ERR "Failed to register WM8711 I2C driver: %d\n", - ret); - } -#endif -#if defined(CONFIG_SPI_MASTER) - ret = spi_register_driver(&wm8711_spi_driver); - if (ret != 0) { - printk(KERN_ERR "Failed to register WM8711 SPI driver: %d\n", - ret); - } -#endif - return 0; -} -module_init(wm8711_modinit); - -static void __exit wm8711_exit(void) -{ -#if IS_ENABLED(CONFIG_I2C) - i2c_del_driver(&wm8711_i2c_driver); -#endif -#if defined(CONFIG_SPI_MASTER) - spi_unregister_driver(&wm8711_spi_driver); -#endif -} -module_exit(wm8711_exit); - MODULE_DESCRIPTION("ASoC WM8711 driver"); MODULE_AUTHOR("Mike Arthur"); MODULE_LICENSE("GPL");