Re: [PATCH] uio: convert drivers/uio/* to usemodule_platform_driver()

From: Hans J. Koch
Date: Mon Nov 28 2011 - 15:30:31 EST


On Sat, Nov 26, 2011 at 03:18:55PM +0800, Axel Lin wrote:
> This patch converts the drivers in drivers/uio/* to use the
> module_platform_driver() macro which makes the code smaller and a bit
> simpler.
>
> Cc: Uwe Kleine-KÃnig <Uwe.Kleine-Koenig@xxxxxxxx>
> Cc: Magnus Damm <damm@xxxxxxxxxx>
> Cc: Amit Chatterjee <amit.chatterjee@xxxxxx>
> Cc: Pratheesh Gangadhar <pratheesh@xxxxxx>
> Signed-off-by: Axel Lin <axel.lin@xxxxxxxxx>

Looks alright to me.

Signed-off-by: Hans J. Koch <hjk@xxxxxxxxxxxx>

Thanks,
Hans

> ---
> drivers/uio/uio_pdrv.c | 12 +-----------
> drivers/uio/uio_pdrv_genirq.c | 13 +------------
> drivers/uio/uio_pruss.c | 14 +-------------
> 3 files changed, 3 insertions(+), 36 deletions(-)
>
> diff --git a/drivers/uio/uio_pdrv.c b/drivers/uio/uio_pdrv.c
> index ff50595..72d3646 100644
> --- a/drivers/uio/uio_pdrv.c
> +++ b/drivers/uio/uio_pdrv.c
> @@ -104,17 +104,7 @@ static struct platform_driver uio_pdrv = {
> },
> };
>
> -static int __init uio_pdrv_init(void)
> -{
> - return platform_driver_register(&uio_pdrv);
> -}
> -
> -static void __exit uio_pdrv_exit(void)
> -{
> - platform_driver_unregister(&uio_pdrv);
> -}
> -module_init(uio_pdrv_init);
> -module_exit(uio_pdrv_exit);
> +module_platform_driver(uio_pdrv);
>
> MODULE_AUTHOR("Uwe Kleine-Koenig");
> MODULE_DESCRIPTION("Userspace I/O platform driver");
> diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c
> index 25de302..b98371d 100644
> --- a/drivers/uio/uio_pdrv_genirq.c
> +++ b/drivers/uio/uio_pdrv_genirq.c
> @@ -273,18 +273,7 @@ static struct platform_driver uio_pdrv_genirq = {
> },
> };
>
> -static int __init uio_pdrv_genirq_init(void)
> -{
> - return platform_driver_register(&uio_pdrv_genirq);
> -}
> -
> -static void __exit uio_pdrv_genirq_exit(void)
> -{
> - platform_driver_unregister(&uio_pdrv_genirq);
> -}
> -
> -module_init(uio_pdrv_genirq_init);
> -module_exit(uio_pdrv_genirq_exit);
> +module_platform_driver(uio_pdrv_genirq);
>
> MODULE_AUTHOR("Magnus Damm");
> MODULE_DESCRIPTION("Userspace I/O platform driver with generic IRQ handling");
> diff --git a/drivers/uio/uio_pruss.c b/drivers/uio/uio_pruss.c
> index e67b566..33a7a27 100644
> --- a/drivers/uio/uio_pruss.c
> +++ b/drivers/uio/uio_pruss.c
> @@ -227,19 +227,7 @@ static struct platform_driver pruss_driver = {
> },
> };
>
> -static int __init pruss_init_module(void)
> -{
> - return platform_driver_register(&pruss_driver);
> -}
> -
> -module_init(pruss_init_module);
> -
> -static void __exit pruss_exit_module(void)
> -{
> - platform_driver_unregister(&pruss_driver);
> -}
> -
> -module_exit(pruss_exit_module);
> +module_platform_driver(pruss_driver);
>
> MODULE_LICENSE("GPL v2");
> MODULE_VERSION(DRV_VERSION);
> --
> 1.7.5.4
>
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/