From: Lorenzo Pieralisi <lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org>
To: "Jon Medhurst (Tixy)" <tixy-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Nicolas Pitre
<nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
"devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org"
<devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org>,
Stephen Boyd <sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
Javi Merino <Javi.Merino-5wv7dgnIgG8@public.gmane.org>,
"rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org"
<rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org>,
Santosh Shilimkar
<santosh.shilimkar-l0cyMroinI0@public.gmane.org>,
Amit Kucheria
<amit.kucheria-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
"grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org"
<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [RFC PATCH v3] drivers: bus: add ARM CCI support
Date: Tue, 21 May 2013 10:21:19 +0100 [thread overview]
Message-ID: <20130521092119.GA1885@e102568-lin.cambridge.arm.com> (raw)
In-Reply-To: <1369051881.3511.4.camel-K+mpW1F5uff9zxVx7UNMDg@public.gmane.org>
On Mon, May 20, 2013 at 01:11:21PM +0100, Jon Medhurst (Tixy) wrote:
> On Thu, 2013-05-09 at 11:34 +0100, Lorenzo Pieralisi wrote:
> [...]
> > +static int __init cci_probe(void)
> > +{
> > + struct cci_nb_ports const *cci_config;
> > + int ret, i, nb_ace = 0, nb_ace_lite = 0;
> > + struct device_node *np, *cp;
> > + const char *match_str;
> > + bool is_ace;
> > +
> > + np = of_find_matching_node(NULL, arm_cci_matches);
> > + if (!np)
> > + return -ENODEV;
> > +
> > + cci_config = of_match_node(arm_cci_matches, np)->data;
> > + if (!cci_config)
> > + return -ENODEV;
> > +
> > + nb_cci_ports = cci_config->nb_ace + cci_config->nb_ace_lite;
> > +
> > + ports = kcalloc(sizeof(*ports), nb_cci_ports, GFP_KERNEL);
> > + if (!ports)
> > + return -ENOMEM;
> > +
> > + cci_ctrl_base = of_iomap(np, 0);
> > +
> > + if (!cci_ctrl_base) {
> > + WARN(1, "unable to ioremap CCI ctrl\n");
> > + ret = -ENXIO;
> > + goto memalloc_err;
> > + }
> > +
> > + for_each_child_of_node(np, cp) {
> > + i = nb_ace + nb_ace_lite;
> > +
> > + if (i >= nb_cci_ports)
> > + break;
>
> I know this is a bit late, but...
>
> Would it not be best to check here that the node type is in fact
> "slave-if", that way if we add support in later versions for other node
> types (e.g. for the PMU) then we don't cause backward compatibility
> issues. I'm thinking here of the same concerns that Rob raised with
> "ARM: kernel: fix arm_dt_init_cpu_maps() to skip non-cpu nodes"
The node name, not type, but point is taken. I prefer to add a
compatible property to slave-if nodes (eg "arm,cci-400-control-if"),
I do not think that checking the node name is the standard way of doing
things in DT world.
Thoughts ?
Thanks,
Lorenzo
> > + if (of_property_read_string(cp, "interface-type",
> > + &match_str)) {
> > + WARN(1, "node %s missing interface-type property\n",
> > + cp->full_name);
> > + continue;
> > + }
> > +
> [..]
>
> --
> Tixy
>
>
next prev parent reply other threads:[~2013-05-21 9:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-09 10:33 [RFC PATCH v3] ARM CCI support Lorenzo Pieralisi
[not found] ` <1368095640-3675-1-git-send-email-lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org>
2013-05-09 10:34 ` [RFC PATCH v3] drivers: bus: add " Lorenzo Pieralisi
2013-05-14 13:00 ` Javi Merino
[not found] ` <20130514130005.GD29592-hBfBd/Xtra/ZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2013-05-14 22:21 ` Nicolas Pitre
[not found] ` <alpine.LFD.2.03.1305141820280.31158-hIgblCxmbi8OMTOF05IoTw@public.gmane.org>
2013-05-15 14:24 ` Lorenzo Pieralisi
[not found] ` <20130515142441.GA385-7AyDDHkRsp3ZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2013-05-15 14:51 ` Nicolas Pitre
[not found] ` <alpine.LFD.2.03.1305151037330.31158-hIgblCxmbi8OMTOF05IoTw@public.gmane.org>
2013-05-15 14:55 ` Lorenzo Pieralisi
[not found] ` <1368095640-3675-2-git-send-email-lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org>
2013-05-20 12:11 ` Jon Medhurst (Tixy)
[not found] ` <1369051881.3511.4.camel-K+mpW1F5uff9zxVx7UNMDg@public.gmane.org>
2013-05-21 9:21 ` Lorenzo Pieralisi [this message]
[not found] ` <20130521092119.GA1885-7AyDDHkRsp3ZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2013-05-21 9:38 ` Benjamin Herrenschmidt
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=20130521092119.GA1885@e102568-lin.cambridge.arm.com \
--to=lorenzo.pieralisi-5wv7dgnigg8@public.gmane.org \
--cc=Javi.Merino-5wv7dgnIgG8@public.gmane.org \
--cc=amit.kucheria-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
--cc=nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=rob.herring-bsGFqQB8/DxBDgjK7y7TUQ@public.gmane.org \
--cc=santosh.shilimkar-l0cyMroinI0@public.gmane.org \
--cc=sboyd-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=tixy-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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;
as well as URLs for NNTP newsgroup(s).