Linux-EDAC Archive on lore.kernel.org
 help / color / Atom feed
* Re: [PATCH -next] EDAC/aspeed: use module_platform_driver to simplify the code
  2020-09-14  6:53 [PATCH -next] EDAC/aspeed: use module_platform_driver to simplify the code Liu Shixin
@ 2020-09-14  6:38 ` Joel Stanley
  2020-09-16 17:22 ` Borislav Petkov
  1 sibling, 0 replies; 3+ messages in thread
From: Joel Stanley @ 2020-09-14  6:38 UTC (permalink / raw)
  To: Liu Shixin
  Cc: Stefan Schaeckeler, Borislav Petkov, Mauro Carvalho Chehab,
	Tony Luck, James Morse, Robert Richter, Andrew Jeffery,
	linux-edac, Linux ARM, linux-aspeed, Linux Kernel Mailing List

On Mon, 14 Sep 2020 at 06:31, 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>

Reviewed-by: Joel Stanley <joel@jms.id.au>

> ---
>  drivers/edac/aspeed_edac.c | 18 +-----------------
>  1 file changed, 1 insertion(+), 17 deletions(-)
>
> diff --git a/drivers/edac/aspeed_edac.c b/drivers/edac/aspeed_edac.c
> index fbec28dc661d..fde809efc520 100644
> --- a/drivers/edac/aspeed_edac.c
> +++ b/drivers/edac/aspeed_edac.c
> @@ -388,23 +388,7 @@ static struct platform_driver aspeed_driver = {
>         .probe          = aspeed_probe,
>         .remove         = aspeed_remove
>  };
> -
> -
> -static int __init aspeed_init(void)
> -{
> -       return platform_driver_register(&aspeed_driver);
> -}
> -
> -
> -static void __exit aspeed_exit(void)
> -{
> -       platform_driver_unregister(&aspeed_driver);
> -}
> -
> -
> -module_init(aspeed_init);
> -module_exit(aspeed_exit);
> -
> +module_platform_driver(aspeed_driver);
>
>  MODULE_LICENSE("GPL");
>  MODULE_AUTHOR("Stefan Schaeckeler <sschaeck@cisco.com>");
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH -next] EDAC/aspeed: use module_platform_driver to simplify the code
@ 2020-09-14  6:53 Liu Shixin
  2020-09-14  6:38 ` Joel Stanley
  2020-09-16 17:22 ` Borislav Petkov
  0 siblings, 2 replies; 3+ messages in thread
From: Liu Shixin @ 2020-09-14  6:53 UTC (permalink / raw)
  To: Stefan Schaeckeler, Borislav Petkov, Mauro Carvalho Chehab,
	Tony Luck, James Morse, Robert Richter, Joel Stanley,
	Andrew Jeffery
  Cc: linux-edac, linux-arm-kernel, linux-aspeed, linux-kernel, Liu Shixin

module_platform_driver() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Liu Shixin <liushixin2@huawei.com>
---
 drivers/edac/aspeed_edac.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/edac/aspeed_edac.c b/drivers/edac/aspeed_edac.c
index fbec28dc661d..fde809efc520 100644
--- a/drivers/edac/aspeed_edac.c
+++ b/drivers/edac/aspeed_edac.c
@@ -388,23 +388,7 @@ static struct platform_driver aspeed_driver = {
 	.probe		= aspeed_probe,
 	.remove		= aspeed_remove
 };
-
-
-static int __init aspeed_init(void)
-{
-	return platform_driver_register(&aspeed_driver);
-}
-
-
-static void __exit aspeed_exit(void)
-{
-	platform_driver_unregister(&aspeed_driver);
-}
-
-
-module_init(aspeed_init);
-module_exit(aspeed_exit);
-
+module_platform_driver(aspeed_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Stefan Schaeckeler <sschaeck@cisco.com>");
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] EDAC/aspeed: use module_platform_driver to simplify the code
  2020-09-14  6:53 [PATCH -next] EDAC/aspeed: use module_platform_driver to simplify the code Liu Shixin
  2020-09-14  6:38 ` Joel Stanley
@ 2020-09-16 17:22 ` Borislav Petkov
  1 sibling, 0 replies; 3+ messages in thread
From: Borislav Petkov @ 2020-09-16 17:22 UTC (permalink / raw)
  To: Liu Shixin
  Cc: Stefan Schaeckeler, Mauro Carvalho Chehab, Tony Luck,
	James Morse, Robert Richter, Joel Stanley, Andrew Jeffery,
	linux-edac, linux-arm-kernel, linux-aspeed, linux-kernel

On Mon, Sep 14, 2020 at 02:53:58PM +0800, Liu Shixin wrote:
> module_platform_driver() makes the code simpler by eliminating
> boilerplate code.
> 
> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
> ---
>  drivers/edac/aspeed_edac.c | 18 +-----------------
>  1 file changed, 1 insertion(+), 17 deletions(-)
> 
> diff --git a/drivers/edac/aspeed_edac.c b/drivers/edac/aspeed_edac.c
> index fbec28dc661d..fde809efc520 100644
> --- a/drivers/edac/aspeed_edac.c
> +++ b/drivers/edac/aspeed_edac.c
> @@ -388,23 +388,7 @@ static struct platform_driver aspeed_driver = {
>  	.probe		= aspeed_probe,
>  	.remove		= aspeed_remove
>  };
> -
> -
> -static int __init aspeed_init(void)
> -{
> -	return platform_driver_register(&aspeed_driver);
> -}
> -
> -
> -static void __exit aspeed_exit(void)
> -{
> -	platform_driver_unregister(&aspeed_driver);
> -}
> -
> -
> -module_init(aspeed_init);
> -module_exit(aspeed_exit);
> -
> +module_platform_driver(aspeed_driver);
>  
>  MODULE_LICENSE("GPL");
>  MODULE_AUTHOR("Stefan Schaeckeler <sschaeck@cisco.com>");
> -- 

Applied, thanks.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-14  6:53 [PATCH -next] EDAC/aspeed: use module_platform_driver to simplify the code Liu Shixin
2020-09-14  6:38 ` Joel Stanley
2020-09-16 17:22 ` Borislav Petkov

Linux-EDAC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-edac/0 linux-edac/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-edac linux-edac/ https://lore.kernel.org/linux-edac \
		linux-edac@vger.kernel.org
	public-inbox-index linux-edac

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-edac


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git