* [PATCH -next] iio: adc: palmas_gpadc: use module_platform_driver to simplify the code
@ 2020-09-14 6:54 Liu Shixin
2020-09-16 18:10 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Liu Shixin @ 2020-09-14 6:54 UTC (permalink / raw)
To: Jonathan Cameron, Hartmut Knaack; +Cc: linux-iio, linux-kernel, Liu Shixin
module_platform_driver() makes the code simpler by eliminating
boilerplate code.
Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
drivers/iio/adc/palmas_gpadc.c | 13 +------------
1 file changed, 1 insertion(+), 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>");
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] iio: adc: palmas_gpadc: use module_platform_driver to simplify the code
2020-09-14 6:54 [PATCH -next] iio: adc: palmas_gpadc: use module_platform_driver to simplify the code Liu Shixin
@ 2020-09-16 18:10 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2020-09-16 18:10 UTC (permalink / raw)
To: Liu Shixin; +Cc: Hartmut Knaack, linux-iio, linux-kernel
On Mon, 14 Sep 2020 14:54:01 +0800
Liu Shixin <liushixin2@huawei.com> wrote:
> module_platform_driver() makes the code simpler by eliminating
> boilerplate code.
>
> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to see if we missed anything.
Thanks,
Jonathan
> ---
> drivers/iio/adc/palmas_gpadc.c | 13 +------------
> 1 file changed, 1 insertion(+), 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>");
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-09-16 18:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-14 6:54 [PATCH -next] iio: adc: palmas_gpadc: use module_platform_driver to simplify the code Liu Shixin
2020-09-16 18:10 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).