From: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
To: Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Geert Uytterhoeven
<geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>,
Frank Rowand
<frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Mathieu Poirier
<mathieu.poirier-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>,
"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] [RFC] of/platform: Make of_dev_node_match() helper public
Date: Fri, 5 May 2017 21:13:39 +0200 [thread overview]
Message-ID: <CAMuHMdUqKotXhpn_f_4BxLkufetYayDMHLP-QkAt9ze4RBKqqA@mail.gmail.com> (raw)
In-Reply-To: <CAL_JsqKn8CVTMvjD_JwBUENXs9YgsybkVv1PeLQHMB0EDMWbrg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Hi Rob,
On Fri, May 5, 2017 at 8:50 PM, Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> On Fri, May 5, 2017 at 9:52 AM, Geert Uytterhoeven
> <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org> wrote:
>> Several drivers provide their own match functions, identical to
>> of_dev_node_match() in the OF platform core.
>>
>> Reduce duplication by making of_dev_node_match() public.
>> To avoid conflicts, the duplicates in coresight and i2c must be removed
>> at the same time.
>
> I think you are down one level too far. At least the 2 users here are
> just for calls to bus_find_device. We already have a function for that
There are more of them, some used with driver_find_device().
class_find_device() need a slightly different version, as the data pointer
is const. E.g. drivers/spi/spi.c uses both variants...
device_find_child() can use the same callback.
> with of_find_device_by_node at least for platform devices. Perhaps
> rework that to be "struct device *of_find_bus_device_by_node(struct
> bus_type *b, struct device_node *np)" and then wrappers for each bus
> type. And perhaps make a class variant as well. However, we should
> also consider if OF is the right level. Maybe it should be fwnode
> functions?
There are only 2 of these:
$ git grep 'dev->fwnode == data'
drivers/iommu/arm-smmu-v3.c: return dev->fwnode == data;
drivers/iommu/arm-smmu.c: return dev->fwnode == data;
$
while you can find a few dozen of the OF callbacks.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2017-05-05 19:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-05 14:52 [PATCH] [RFC] of/platform: Make of_dev_node_match() helper public Geert Uytterhoeven
2017-05-05 18:50 ` Rob Herring
[not found] ` <CAL_JsqKn8CVTMvjD_JwBUENXs9YgsybkVv1PeLQHMB0EDMWbrg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-05-05 19:13 ` Geert Uytterhoeven [this message]
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=CAMuHMdUqKotXhpn_f_4BxLkufetYayDMHLP-QkAt9ze4RBKqqA@mail.gmail.com \
--to=geert-td1emuhucqxl1znqvxdv9g@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mathieu.poirier-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=wsa-z923LK4zBo2bacvFa/9K2g@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).