From: Arnd Bergmann <arnd@arndb.de>
To: Sanchayan Maity <maitysanchayan@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org, stefan@agner.ch,
shawn.guo@linaro.org, kernel@pengutronix.de,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] soc: Add driver for Freescale Vybrid Platform
Date: Fri, 22 May 2015 13:11:46 +0200 [thread overview]
Message-ID: <35561091.AtkcGa6qVG@wuerfel> (raw)
In-Reply-To: <d27c4ba234cd298914676884a9604ea8472a17d0.1432290463.git.maitysanchayan@gmail.com>
On Friday 22 May 2015 16:21:54 Sanchayan Maity wrote:
> +#define OCOTP_CFG0_OFFSET 0x00000410
> +#define OCOTP_CFG1_OFFSET 0x00000420
> +#define MSCM_CPxCOUNT_OFFSET 0x0000002C
> +#define MSCM_CPxCFG1_OFFSET 0x00000014
> +#define ROM_REVISION_OFFSET 0x00000080
> +
> +static const struct of_device_id vf610_soc_bus_match[] = {
> + { .compatible = "fsl,vf610-mscm-cpucfg", },
> + { /* sentinel */ }
> +};
> +
> +static int __init vf610_soc_init(void)
> +{
> + struct regmap *ocotp_regmap, *mscm_regmap, *rom_regmap;
> + struct soc_device_attribute *soc_dev_attr;
> + struct soc_device *soc_dev;
> + struct device_node *np;
> + char soc_type[] = "xx0";
> + u32 cpxcount, cpxcfg1;
> + u32 soc_id1, soc_id2, rom_rev;
> + u64 soc_id;
> + int ret;
> +
> + np = of_find_matching_node(NULL, vf610_soc_bus_match);
> + if (!np)
> + return -ENODEV;
> +
Why not use module_platform_driver() and make this a probe function instead?
> + ocotp_regmap = syscon_regmap_lookup_by_compatible("fsl,vf610-ocotp");
> + if (IS_ERR(ocotp_regmap)) {
> + pr_err("regmap lookup for octop failed\n");
> + return PTR_ERR(ocotp_regmap);
> + }
> +
> + mscm_regmap = syscon_regmap_lookup_by_compatible("fsl,vf610-mscm-cpucfg");
> + if (IS_ERR(mscm_regmap)) {
> + pr_err("regmap lookup for mscm failed");
> + return PTR_ERR(mscm_regmap);
> + }
> +
> + rom_regmap = syscon_regmap_lookup_by_compatible("fsl,vf610-ocrom");
> + if (IS_ERR(rom_regmap)) {
> + pr_err("regmap lookup for ocrom failed");
> + return PTR_ERR(rom_regmap);
> + }
Can you use syscon_regmap_lookup_by_phandle instead, and put the
phandles in the fsl,vf610-mscm-cpucfg node?
Also, I'd argue that the mscm should not be a syscon device at all,
but instead I'd use platform_get_resource()/devm_ioremap_resource()
to get an __iomem pointer.
Arnd
next prev parent reply other threads:[~2015-05-22 11:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-22 10:51 [PATCH v3 0/2] Implement SoC bus support for Vybrid Sanchayan Maity
2015-05-22 10:51 ` [PATCH v3 1/2] ARM: dts: vfxxx: Add OCOTP and OCROM nodes Sanchayan Maity
2015-05-22 10:51 ` [PATCH v3 2/2] soc: Add driver for Freescale Vybrid Platform Sanchayan Maity
2015-05-22 11:11 ` Arnd Bergmann [this message]
2015-05-22 11:55 ` maitysanchayan
2015-05-22 12:02 ` Stefan Agner
2015-05-22 13:20 ` Arnd Bergmann
2015-05-25 10:17 ` maitysanchayan
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=35561091.AtkcGa6qVG@wuerfel \
--to=arnd@arndb.de \
--cc=devicetree@vger.kernel.org \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maitysanchayan@gmail.com \
--cc=shawn.guo@linaro.org \
--cc=stefan@agner.ch \
/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