[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111127202212.44ebf4c4@endymion.delvare>
Date: Sun, 27 Nov 2011 20:22:12 +0100
From: Jean Delvare <khali@...ux-fr.org>
To: Axel Lin <axel.lin@...il.com>
Cc: linux-kernel@...r.kernel.org, Ben Dooks <ben-linux@...ff.org>,
Jochen Friedrich <jochen@...am.de>,
Peter Korsgaard <jacmet@...site.dk>,
Wolfram Sang <w.sang@...gutronix.de>,
Guan Xuetao <gxt@...c.pku.edu.cn>,
Manuel Lauss <manuel.lauss@...glemail.com>,
Barry Song <21cnbao@...il.com>,
Linus Walleij <linus.walleij@...aro.org>,
Yong Zhang <yong.zhang0@...il.com>,
Lucas De Marchi <lucas.demarchi@...fusion.mobi>,
Grant Likely <grant.likely@...retlab.ca>,
Samuel Ortiz <sameo@...ux.intel.com>, linux-i2c@...r.kernel.org
Subject: Re: [PATCH] i2c: convert drivers/i2c/* to use
module_platform_driver()
Hi Axel,
On Sun, 27 Nov 2011 14:12:12 +0800, Axel Lin wrote:
> This patch converts the drivers in drivers/i2c/* to use the
> module_platform_driver() macro which makes the code smaller and a bit
> simpler.
>
> Cc: Jean Delvare <khali@...ux-fr.org>
> Cc: Ben Dooks <ben-linux@...ff.org>
> Cc: Jochen Friedrich <jochen@...am.de>
> Cc: Peter Korsgaard <jacmet@...site.dk>
> Cc: Wolfram Sang <w.sang@...gutronix.de>
> Cc: Guan Xuetao <gxt@...c.pku.edu.cn>
> Cc: Manuel Lauss <manuel.lauss@...glemail.com>
> Cc: Barry Song <21cnbao@...il.com>
> Cc: Linus Walleij <linus.walleij@...aro.org>
> Cc: Yong Zhang <yong.zhang0@...il.com>
> Cc: Lucas De Marchi <lucas.demarchi@...fusion.mobi>
> Cc: Grant Likely <grant.likely@...retlab.ca>
> Cc: Samuel Ortiz <sameo@...ux.intel.com>
> Signed-off-by: Axel Lin <axel.lin@...il.com>
> ---
> drivers/i2c/busses/i2c-at91.c | 17 ++---------------
> drivers/i2c/busses/i2c-au1550.c | 13 +------------
> drivers/i2c/busses/i2c-cpm.c | 13 +------------
> drivers/i2c/busses/i2c-highlander.c | 13 +------------
> drivers/i2c/busses/i2c-ibm_iic.c | 13 +------------
> drivers/i2c/busses/i2c-iop3xx.c | 16 +---------------
> drivers/i2c/busses/i2c-isch.c | 13 +------------
> drivers/i2c/busses/i2c-ixp2000.c | 13 +------------
> drivers/i2c/busses/i2c-mpc.c | 13 +------------
> drivers/i2c/busses/i2c-mv64xxx.c | 15 +--------------
> drivers/i2c/busses/i2c-ocores.c | 17 ++---------------
> drivers/i2c/busses/i2c-octeon.c | 16 +---------------
> drivers/i2c/busses/i2c-pca-platform.c | 14 +-------------
> drivers/i2c/busses/i2c-pmcmsp.c | 17 ++---------------
> drivers/i2c/busses/i2c-powermac.c | 19 ++-----------------
> drivers/i2c/busses/i2c-puv3.c | 16 ++--------------
> drivers/i2c/busses/i2c-sh7760.c | 13 +------------
> drivers/i2c/busses/i2c-simtec.c | 20 ++------------------
> drivers/i2c/busses/i2c-xiic.c | 18 ++----------------
> drivers/i2c/muxes/gpio-i2cmux.c | 13 +------------
> 20 files changed, 27 insertions(+), 275 deletions(-)
Looks overall good. I'd rather let Ben apply it as most affected
drivers are for embedded platforms.
Just two minor comments:
> --- a/drivers/i2c/busses/i2c-simtec.c
> +++ b/drivers/i2c/busses/i2c-simtec.c
> @@ -156,12 +156,6 @@ static int simtec_i2c_remove(struct platform_device *dev)
> return 0;
> }
>
> -
> -/* device driver */
I see no good reason for removing that comment.
> -
> -/* work with hotplug and coldplug */
> -MODULE_ALIAS("platform:simtec-i2c");
> -
> static struct platform_driver simtec_i2c_driver = {
> .driver = {
> .name = "simtec-i2c",
> @@ -171,19 +165,9 @@ static struct platform_driver simtec_i2c_driver = {
> .remove = simtec_i2c_remove,
> };
>
> -static int __init i2c_adap_simtec_init(void)
> -{
> - return platform_driver_register(&simtec_i2c_driver);
> -}
> -
> -static void __exit i2c_adap_simtec_exit(void)
> -{
> - platform_driver_unregister(&simtec_i2c_driver);
> -}
> -
> -module_init(i2c_adap_simtec_init);
> -module_exit(i2c_adap_simtec_exit);
> +module_platform_driver(simtec_i2c_driver);
>
> MODULE_DESCRIPTION("Simtec Generic I2C Bus driver");
> MODULE_AUTHOR("Ben Dooks <ben@...tec.co.uk>");
> MODULE_LICENSE("GPL");
> +MODULE_ALIAS("platform:simtec-i2c");
> (...)
> diff --git a/drivers/i2c/muxes/gpio-i2cmux.c b/drivers/i2c/muxes/gpio-i2cmux.c
> index 7b6ce62..e5fa695 100644
> --- a/drivers/i2c/muxes/gpio-i2cmux.c
> +++ b/drivers/i2c/muxes/gpio-i2cmux.c
> @@ -165,18 +165,7 @@ static struct platform_driver gpiomux_driver = {
> },
> };
>
> -static int __init gpiomux_init(void)
> -{
> - return platform_driver_register(&gpiomux_driver);
> -}
> -
> -static void __exit gpiomux_exit(void)
> -{
> - platform_driver_unregister(&gpiomux_driver);
> -}
> -
> -module_init(gpiomux_init);
> -module_exit(gpiomux_exit);
> +module_platform_driver(gpiomux_driver);
This one would be better as a separate patch, as it touches a different
subdirectory, which I am responsible for.
--
Jean Delvare
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists