[alsa-devel] [PATCH v2 1/2] ALSA: sound/atmel/ac97c.c: Convert to module_platform_driver
This reduces some boilerplate code.
Signed-off-by: Alexander Stein alexanders83@web.de Acked-by: Alexandre Belloni alexandre.belloni@free-electrons.com --- sound/atmel/ac97c.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c index 05ec049..a04d2317 100644 --- a/sound/atmel/ac97c.c +++ b/sound/atmel/ac97c.c @@ -1198,6 +1198,7 @@ static int atmel_ac97c_remove(struct platform_device *pdev) }
static struct platform_driver atmel_ac97c_driver = { + .probe = atmel_ac97c_probe, .remove = atmel_ac97c_remove, .driver = { .name = "atmel_ac97c", @@ -1205,19 +1206,7 @@ static struct platform_driver atmel_ac97c_driver = { .pm = ATMEL_AC97C_PM_OPS, }, }; - -static int __init atmel_ac97c_init(void) -{ - return platform_driver_probe(&atmel_ac97c_driver, - atmel_ac97c_probe); -} -module_init(atmel_ac97c_init); - -static void __exit atmel_ac97c_exit(void) -{ - platform_driver_unregister(&atmel_ac97c_driver); -} -module_exit(atmel_ac97c_exit); +module_platform_driver(atmel_ac97c_driver);
MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Driver for Atmel AC97 controller");
This platform data member is unused, so remove it.
Signed-off-by: Alexander Stein alexanders83@web.de Acked-by: Alexandre Belloni alexandre.belloni@free-electrons.com --- include/sound/atmel-ac97c.h | 2 -- 1 file changed, 2 deletions(-)
diff --git a/include/sound/atmel-ac97c.h b/include/sound/atmel-ac97c.h index e6aabdb..00e6c289 100644 --- a/include/sound/atmel-ac97c.h +++ b/include/sound/atmel-ac97c.h @@ -23,7 +23,6 @@ * @reset_pin: GPIO pin wired to the reset input on the external AC97 codec, * optional to use, set to -ENODEV if not in use. AC97 layer will * try to do a software reset of the external codec anyway. - * @flags: Flags for which directions should be enabled. * * If the user do not want to use a DMA channel for playback or capture, i.e. * only one feature is required on the board. The slave for playback or capture @@ -33,7 +32,6 @@ struct ac97c_platform_data { struct dw_dma_slave rx_dws; struct dw_dma_slave tx_dws; - unsigned int flags; int reset_pin; };
On 15/04/2014 19:38, Alexander Stein :
This platform data member is unused, so remove it.
Signed-off-by: Alexander Stein alexanders83@web.de Acked-by: Alexandre Belloni alexandre.belloni@free-electrons.com
Acked-by: Nicolas Ferre nicolas.ferre@atmel.com
include/sound/atmel-ac97c.h | 2 -- 1 file changed, 2 deletions(-)
diff --git a/include/sound/atmel-ac97c.h b/include/sound/atmel-ac97c.h index e6aabdb..00e6c289 100644 --- a/include/sound/atmel-ac97c.h +++ b/include/sound/atmel-ac97c.h @@ -23,7 +23,6 @@
- @reset_pin: GPIO pin wired to the reset input on the external AC97 codec,
optional to use, set to -ENODEV if not in use. AC97 layer will
try to do a software reset of the external codec anyway.
- @flags: Flags for which directions should be enabled.
- If the user do not want to use a DMA channel for playback or capture, i.e.
- only one feature is required on the board. The slave for playback or capture
@@ -33,7 +32,6 @@ struct ac97c_platform_data { struct dw_dma_slave rx_dws; struct dw_dma_slave tx_dws;
- unsigned int flags; int reset_pin;
};
On 15/04/2014 19:38, Alexander Stein :
This reduces some boilerplate code.
Signed-off-by: Alexander Stein alexanders83@web.de Acked-by: Alexandre Belloni alexandre.belloni@free-electrons.com
Acked-by: Nicolas Ferre nicolas.ferre@atmel.com
Thanks
sound/atmel/ac97c.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c index 05ec049..a04d2317 100644 --- a/sound/atmel/ac97c.c +++ b/sound/atmel/ac97c.c @@ -1198,6 +1198,7 @@ static int atmel_ac97c_remove(struct platform_device *pdev) }
static struct platform_driver atmel_ac97c_driver = {
- .probe = atmel_ac97c_probe, .remove = atmel_ac97c_remove, .driver = { .name = "atmel_ac97c",
@@ -1205,19 +1206,7 @@ static struct platform_driver atmel_ac97c_driver = { .pm = ATMEL_AC97C_PM_OPS, }, };
-static int __init atmel_ac97c_init(void) -{
- return platform_driver_probe(&atmel_ac97c_driver,
atmel_ac97c_probe);
-} -module_init(atmel_ac97c_init);
-static void __exit atmel_ac97c_exit(void) -{
- platform_driver_unregister(&atmel_ac97c_driver);
-} -module_exit(atmel_ac97c_exit); +module_platform_driver(atmel_ac97c_driver);
MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Driver for Atmel AC97 controller");
At Tue, 15 Apr 2014 19:38:56 +0200, Alexander Stein wrote:
This reduces some boilerplate code.
Signed-off-by: Alexander Stein alexanders83@web.de Acked-by: Alexandre Belloni alexandre.belloni@free-electrons.com
Thanks, applied these two cleanup patches now.
Takashi
sound/atmel/ac97c.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c index 05ec049..a04d2317 100644 --- a/sound/atmel/ac97c.c +++ b/sound/atmel/ac97c.c @@ -1198,6 +1198,7 @@ static int atmel_ac97c_remove(struct platform_device *pdev) }
static struct platform_driver atmel_ac97c_driver = {
- .probe = atmel_ac97c_probe, .remove = atmel_ac97c_remove, .driver = { .name = "atmel_ac97c",
@@ -1205,19 +1206,7 @@ static struct platform_driver atmel_ac97c_driver = { .pm = ATMEL_AC97C_PM_OPS, }, };
-static int __init atmel_ac97c_init(void) -{
- return platform_driver_probe(&atmel_ac97c_driver,
atmel_ac97c_probe);
-} -module_init(atmel_ac97c_init);
-static void __exit atmel_ac97c_exit(void) -{
- platform_driver_unregister(&atmel_ac97c_driver);
-} -module_exit(atmel_ac97c_exit); +module_platform_driver(atmel_ac97c_driver);
MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Driver for Atmel AC97 controller"); -- 1.9.2
participants (3)
-
Alexander Stein
-
Nicolas Ferre
-
Takashi Iwai