From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
mchehab@osg.samsung.com, jcm@redhat.com,
ijc+devicetree@hellion.org.uk, patches@apm.com,
Feng Kan <fkan@apm.com>,
robh+dt@kernel.org, bp@alien8.de, Loc Ho <lho@apm.com>,
dougthompson@xmission.com, linux-edac@vger.kernel.org
Subject: Re: [PATCH v7 4/5] edac: Add APM X-Gene SoC EDAC driver
Date: Wed, 29 Apr 2015 10:49:07 +0200 [thread overview]
Message-ID: <4492781.xynGhSMMir@wuerfel> (raw)
In-Reply-To: <1430259045-19012-5-git-send-email-lho@apm.com>
On Tuesday 28 April 2015 16:10:44 Loc Ho wrote:
> +
> + rc = platform_driver_register(&xgene_edac_mc_driver);
> + if (rc) {
> + edac_printk(KERN_ERR, EDAC_MOD_STR, "MCU fails to register\n");
> + goto reg_mc_failed;
> + }
> + rc = platform_driver_register(&xgene_edac_pmd_driver);
> + if (rc) {
> + edac_printk(KERN_ERR, EDAC_MOD_STR, "PMD fails to register\n");
> + goto reg_pmd_failed;
> + }
> + rc = platform_driver_register(&xgene_edac_l3_driver);
> + if (rc) {
> + edac_printk(KERN_ERR, EDAC_MOD_STR, "L3 fails to register\n");
> + goto reg_l3_failed;
> + }
> + rc = platform_driver_register(&xgene_edac_soc_driver);
> + if (rc) {
> + edac_printk(KERN_ERR, EDAC_MOD_STR, "SoC fails to register\n");
> + goto reg_soc_failed;
> + }
>
I had not looked at the driver before, but I have one comment now:
I think this can be simplified to registering a single platform_driver
that just matches all four compatible strings, with an appropriate data:
+static struct of_device_id xgene_edac_of_match[] = {
+ { .compatible = "apm,xgene-edac-mcu", .data = &xgene_edac_mcu_data },
+ { .compatible = "apm,xgene-edac-pmd", .data = &xgene_edac_pmd_data },
+ { .compatible = "apm,xgene-edac-l3", .data = &xgene_edac_l3_data },
+ { .compatible = "apm,xgene-edac-soc", .data = &xgene_edac_soc_data },
+ {},
+};
+MODULE_DEVICE_TABLE(of, xgene_edac_soc_of_match);
+
+static struct platform_driver xgene_edac_soc_driver = {
+ .probe = xgene_edac_soc_probe,
+ .remove = xgene_edac_soc_remove,
+ .driver = {
+ .name = "xgene-edac-soc",
+ .owner = THIS_MODULE,
+ .of_match_table = xgene_edac_of_match,
+ },
+};
You can probably share most of the four probe and release
functions as well, and put the differences into the data structure
that is attached to the of_device_id entry.
As a style-only comment, you can also remove the #ifdef CONFIG_OF and
of_match_ptr(), because the driver depends on OF anyway.
Arnd
next prev parent reply other threads:[~2015-04-29 8:49 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-28 22:10 [PATCH v7 0/4] edac: Add APM X-Gene SoC EDAC driver Loc Ho
[not found] ` <1430259045-19012-1-git-send-email-lho-qTEPVZfXA3Y@public.gmane.org>
2015-04-28 22:10 ` [PATCH v7 1/5] arm64: Enable EDAC on ARM64 Loc Ho
[not found] ` <1430259045-19012-2-git-send-email-lho-qTEPVZfXA3Y@public.gmane.org>
2015-04-28 22:10 ` [PATCH v7 2/5] MAINTAINERS: Add entry for APM X-Gene SoC EDAC driver Loc Ho
[not found] ` <1430259045-19012-3-git-send-email-lho-qTEPVZfXA3Y@public.gmane.org>
2015-04-28 22:10 ` [PATCH v7 3/5] Documentation: Add documentation for the APM X-Gene SoC EDAC DTS binding Loc Ho
[not found] ` <1430259045-19012-4-git-send-email-lho-qTEPVZfXA3Y@public.gmane.org>
2015-04-28 22:10 ` [PATCH v7 4/5] edac: Add APM X-Gene SoC EDAC driver Loc Ho
2015-04-29 8:49 ` Arnd Bergmann [this message]
2015-04-29 16:57 ` Rob Herring
2015-04-29 18:23 ` Arnd Bergmann
[not found] ` <1430259045-19012-5-git-send-email-lho-qTEPVZfXA3Y@public.gmane.org>
2015-04-28 22:10 ` [PATCH 5/5] arm64: Add APM X-Gene SoC EDAC DTS entries Loc Ho
2015-04-29 17:00 ` [PATCH v7 4/5] edac: Add APM X-Gene SoC EDAC driver Rob Herring
2015-04-29 16:47 ` [PATCH v7 3/5] Documentation: Add documentation for the APM X-Gene SoC EDAC DTS binding Rob Herring
[not found] ` <CAL_Jsq+nhPUxHxrStB9cdy1YzE7tVPFVR1MrWq3Bz-JUa=3Rvg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-29 21:33 ` Loc Ho
[not found] ` <CAPw-ZTnLR10Zr_p8L3-1nBZ+jKE1HCwERDmO=S5as2GLqime3A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-29 21:49 ` Borislav Petkov
[not found] ` <20150429214924.GH5498-fF5Pk5pvG8Y@public.gmane.org>
2015-04-29 21:56 ` Loc Ho
[not found] ` <CAPw-ZTmoash48S3F8kBxsovD0mEPYBO8=XDaJ2peDu60yaGrZQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-29 22:08 ` Borislav Petkov
[not found] ` <20150429220830.GI5498-fF5Pk5pvG8Y@public.gmane.org>
2015-04-29 22:20 ` Loc Ho
2015-04-29 23:02 ` Rob Herring
[not found] ` <CAL_JsqL8UnDco14Z8H7ZcxS=fLNiYgSb6ivv=zzpVctiD0FptA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-30 8:20 ` Borislav Petkov
[not found] ` <20150430082051.GA3488-fF5Pk5pvG8Y@public.gmane.org>
2015-04-30 8:31 ` Arnd Bergmann
2015-04-30 8:45 ` Borislav Petkov
[not found] ` <20150430084549.GB3488-fF5Pk5pvG8Y@public.gmane.org>
2015-04-30 9:01 ` Arnd Bergmann
2015-04-30 9:41 ` Borislav Petkov
[not found] ` <20150430094134.GD3488-fF5Pk5pvG8Y@public.gmane.org>
2015-04-30 10:21 ` Arnd Bergmann
2015-04-30 12:33 ` Borislav Petkov
[not found] ` <20150430123300.GE3488-fF5Pk5pvG8Y@public.gmane.org>
2015-04-30 12:52 ` Arnd Bergmann
2015-04-30 10:42 ` Arnd Bergmann
2015-04-30 13:00 ` Borislav Petkov
[not found] ` <20150430130028.GF3488-fF5Pk5pvG8Y@public.gmane.org>
2015-04-30 16:57 ` Loc Ho
[not found] ` <CAPw-ZTnuyB2ne1C2-38qAxM_ANwdr9nuCYUMj=aTx7c90sVg+Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-30 17:18 ` Borislav Petkov
2015-04-30 21:19 ` Loc Ho
[not found] ` <CAPw-ZTksYNDE2zVD=ZjGzpKfXQN8KgW85ZnHoQ2eVmSGdSdMOw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-30 21:30 ` Borislav Petkov
[not found] ` <20150430213045.GK3488-fF5Pk5pvG8Y@public.gmane.org>
2015-04-30 21:39 ` Loc Ho
2015-04-30 22:36 ` Rob Herring
[not found] ` <CAL_JsqL7emqq=bSaWSi_0G5qSJqO+nVH_JH7VY+ynbrHhaSf_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-30 22:47 ` Arnd Bergmann
2015-05-01 6:44 ` Loc Ho
2015-04-30 22:59 ` Loc Ho
2015-05-01 19:59 ` Loc Ho
2015-05-04 22:36 ` Rob Herring
[not found] ` <CAL_JsqLyyBCd3DcwjWw57XCQ0fEWHXo_0dkWeBo=TVDoXM_zhQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-04 23:39 ` Loc Ho
2015-04-29 22:43 ` Rob Herring
[not found] ` <CAL_JsqL0BMmpVT6hK23ZOhiGRscv1UDYWirA0ik4UZuXf5ku2Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-30 0:47 ` Loc Ho
2015-04-29 14:40 ` [PATCH v7 1/5] arm64: Enable EDAC on ARM64 Catalin Marinas
[not found] ` <20150429144031.GB18867-M2fw3Uu6cmfZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2015-04-29 14:46 ` Jon Masters
2015-04-29 21:39 ` Loc Ho
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=4492781.xynGhSMMir@wuerfel \
--to=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=devicetree@vger.kernel.org \
--cc=dougthompson@xmission.com \
--cc=fkan@apm.com \
--cc=ijc+devicetree@hellion.org.uk \
--cc=jcm@redhat.com \
--cc=lho@apm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-edac@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mchehab@osg.samsung.com \
--cc=patches@apm.com \
--cc=robh+dt@kernel.org \
/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