staging/iio: use module_platform_driver macro
authorDevendra Naga <develkernel412222@gmail.com>
Sat, 21 Jul 2012 08:54:00 +0000 (09:54 +0100)
committerJonathan Cameron <jic23@kernel.org>
Tue, 14 Aug 2012 19:31:12 +0000 (20:31 +0100)
the code which under _init and _exit does only the platform_driver_register
and platform_driver_unregister, and nothing else,
so its better to use the module_platform_driver macro rather duplicating
its implementation

Signed-off-by: Devendra Naga <develkernel412222@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/iio_hwmon.c

index 27d27ec9521fed522e628df2c7c4f31c6933e408..4bb017acbf41c214f19e79dcf55949ddcfe55c8d 100644 (file)
@@ -215,17 +215,7 @@ static struct platform_driver __refdata iio_hwmon_driver = {
        .remove = __devexit_p(iio_hwmon_remove),
 };
 
-static int iio_inkern_init(void)
-{
-       return platform_driver_register(&iio_hwmon_driver);
-}
-module_init(iio_inkern_init);
-
-static void iio_inkern_exit(void)
-{
-       platform_driver_unregister(&iio_hwmon_driver);
-}
-module_exit(iio_inkern_exit);
+module_platform_driver(iio_hwmon_driver);
 
 MODULE_AUTHOR("Jonathan Cameron <jic23@cam.ac.uk>");
 MODULE_DESCRIPTION("IIO to hwmon driver");