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-simtec.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'drivers/i2c/busses/i2c-simtec.c') diff --git a/drivers/i2c/busses/i2c-simtec.c b/drivers/i2c/busses/i2c-simtec.c index 2fc08fbf67a..4fc87e7c94c 100644 --- a/drivers/i2c/busses/i2c-simtec.c +++ b/drivers/i2c/busses/i2c-simtec.c @@ -156,12 +156,8 @@ static int simtec_i2c_remove(struct platform_device *dev) return 0; } - /* device driver */ -/* work with hotplug and coldplug */ -MODULE_ALIAS("platform:simtec-i2c"); - static struct platform_driver simtec_i2c_driver = { .driver = { .name = "simtec-i2c", @@ -171,19 +167,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 "); MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:simtec-i2c"); -- cgit v1.2.3-70-g09d2