diff options
author | Liu Shixin <liushixin2@huawei.com> | 2020-09-14 14:54:01 +0800 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2020-09-16 19:09:51 +0100 |
commit | d4a4b78a0c0411820f131bcca4a14552089b7cbc (patch) | |
tree | 98bfa5220b6ca7a12a8111cf78b4f91017fab6bd | |
parent | d8f0cd76684e679d4a8ec4929fcdf6c3a030a007 (diff) | |
download | linux-stable-d4a4b78a0c0411820f131bcca4a14552089b7cbc.tar.gz linux-stable-d4a4b78a0c0411820f131bcca4a14552089b7cbc.tar.bz2 linux-stable-d4a4b78a0c0411820f131bcca4a14552089b7cbc.zip |
iio: adc: palmas_gpadc: use module_platform_driver to simplify the code
module_platform_driver() makes the code simpler by eliminating
boilerplate code.
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Link: https://lore.kernel.org/r/20200914065401.3726354-1-liushixin2@huawei.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r-- | drivers/iio/adc/palmas_gpadc.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/iio/adc/palmas_gpadc.c b/drivers/iio/adc/palmas_gpadc.c index 1ca6570be66a..889b88768b63 100644 --- a/drivers/iio/adc/palmas_gpadc.c +++ b/drivers/iio/adc/palmas_gpadc.c @@ -834,18 +834,7 @@ static struct platform_driver palmas_gpadc_driver = { .of_match_table = of_palmas_gpadc_match_tbl, }, }; - -static int __init palmas_gpadc_init(void) -{ - return platform_driver_register(&palmas_gpadc_driver); -} -module_init(palmas_gpadc_init); - -static void __exit palmas_gpadc_exit(void) -{ - platform_driver_unregister(&palmas_gpadc_driver); -} -module_exit(palmas_gpadc_exit); +module_platform_driver(palmas_gpadc_driver); MODULE_DESCRIPTION("palmas GPADC driver"); MODULE_AUTHOR("Pradeep Goudagunta<pgoudagunta@nvidia.com>"); |