public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Xie XiuQi <xiexiuqi@huawei.com>
To: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>,
	Johannes Thumshirn <johannes.thumshirn@men.de>,
	Doug Thompson <dougthompson@xmission.com>,
	<linux-edac@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] cpc925_edac: Use module_platform_driver()
Date: Tue, 10 Jun 2014 10:44:48 +0800	[thread overview]
Message-ID: <53967120.8010806@huawei.com> (raw)
In-Reply-To: <1402324818-12300-1-git-send-email-wangkefeng.wang@huawei.com>

On 2014/6/9 22:40, Kefeng Wang wrote:
> Move edac_op_state assignment operations to probe, then convert to
> module_platform_drive() to eliminate boilerplate code, and use

module_platform_driver() ;-)

> cpc925_printk instead of printk.
> 
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
>  drivers/edac/cpc925_edac.c |   33 +++++++--------------------------
>  1 files changed, 7 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/edac/cpc925_edac.c b/drivers/edac/cpc925_edac.c
> index df6575f..8e3192a 100644
> --- a/drivers/edac/cpc925_edac.c
> +++ b/drivers/edac/cpc925_edac.c
> @@ -944,6 +944,12 @@ static int cpc925_probe(struct platform_device *pdev)
>  
>  	edac_dbg(0, "%s platform device found!\n", pdev->name);
>  
> +	cpc925_printk(KERN_INFO, CPC925_EDAC_REVISION "\n");
> +	cpc925_printk(KERN_INFO, "\t(c) 2008 Wind River Systems, Inc\n");
> +
> +	/* Only support POLL mode so far */
> +	edac_op_state = EDAC_OPSTATE_POLL;
> +
>  	if (!devres_open_group(&pdev->dev, cpc925_probe, GFP_KERNEL)) {
>  		res = -ENOMEM;
>  		goto out;
> @@ -1065,32 +1071,7 @@ static struct platform_driver cpc925_edac_driver = {
>  	}
>  };
>  
> -static int __init cpc925_edac_init(void)
> -{
> -	int ret = 0;
> -
> -	printk(KERN_INFO "IBM CPC925 EDAC driver " CPC925_EDAC_REVISION "\n");
> -	printk(KERN_INFO "\t(c) 2008 Wind River Systems, Inc\n");
> -
> -	/* Only support POLL mode so far */
> -	edac_op_state = EDAC_OPSTATE_POLL;
> -
> -	ret = platform_driver_register(&cpc925_edac_driver);
> -	if (ret) {
> -		printk(KERN_WARNING "Failed to register %s\n",
> -			CPC925_EDAC_MOD_STR);
> -	}
> -
> -	return ret;
> -}
> -
> -static void __exit cpc925_edac_exit(void)
> -{
> -	platform_driver_unregister(&cpc925_edac_driver);
> -}
> -
> -module_init(cpc925_edac_init);
> -module_exit(cpc925_edac_exit);
> +module_platform_driver(cpc925_edac_driver);
>  
>  MODULE_LICENSE("GPL");
>  MODULE_AUTHOR("Cao Qingtao <qingtao.cao@windriver.com>");
> 



  parent reply	other threads:[~2014-06-10  2:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-09 14:40 [PATCH] cpc925_edac: Use module_platform_driver() Kefeng Wang
2014-06-10  1:57 ` [PATCH] cpc925_eadc: Use devm_ioremap_resource() Kefeng Wang
2014-07-03 13:22   ` Borislav Petkov
2014-06-10  2:44 ` Xie XiuQi [this message]
2014-07-03 11:49 ` [PATCH] cpc925_edac: Use module_platform_driver() Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53967120.8010806@huawei.com \
    --to=xiexiuqi@huawei.com \
    --cc=dougthompson@xmission.com \
    --cc=johannes.thumshirn@men.de \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=wangkefeng.wang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox