From a3664b51c783aaa0dde1c95334d1a670d6d54590 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 12 Jan 2012 20:32:04 +0100 Subject: i2c/busses: Use module_platform_driver() Convert the drivers in drivers/i2c/busses/* to use the module_platform_driver() macro which makes the code smaller and a bit simpler. Cc: Ben Dooks Acked-by: Jochen Friedrich Acked-by: Peter Korsgaard Acked-by: Wolfram Sang Cc: Manuel Lauss Cc: Barry Song <21cnbao@gmail.com> Cc: Linus Walleij Cc: Yong Zhang Cc: Lucas De Marchi Cc: Grant Likely Cc: Samuel Ortiz Signed-off-by: Axel Lin Signed-off-by: Jean Delvare --- drivers/i2c/busses/i2c-xiic.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'drivers/i2c/busses/i2c-xiic.c') diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index ac083a28ae08..2bded7647ef2 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -795,10 +795,6 @@ static int __devexit xiic_i2c_remove(struct platform_device* pdev) return 0; } - -/* work with hotplug and coldplug */ -MODULE_ALIAS("platform:"DRIVER_NAME); - static struct platform_driver xiic_i2c_driver = { .probe = xiic_i2c_probe, .remove = __devexit_p(xiic_i2c_remove), @@ -808,19 +804,9 @@ static struct platform_driver xiic_i2c_driver = { }, }; -static int __init xiic_i2c_init(void) -{ - return platform_driver_register(&xiic_i2c_driver); -} - -static void __exit xiic_i2c_exit(void) -{ - platform_driver_unregister(&xiic_i2c_driver); -} - -module_init(xiic_i2c_init); -module_exit(xiic_i2c_exit); +module_platform_driver(xiic_i2c_driver); MODULE_AUTHOR("info@mocean-labs.com"); MODULE_DESCRIPTION("Xilinx I2C bus driver"); MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:"DRIVER_NAME); -- cgit v1.2.3