From: linux@armlinux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] drm: convert DT component matching to component_match_add_release()
Date: Fri, 3 Jun 2016 15:15:48 +0100 [thread overview]
Message-ID: <20160603141548.GC1041@n2100.armlinux.org.uk> (raw)
In-Reply-To: <57516268.3020401@arm.com>
On Fri, Jun 03, 2016 at 11:56:40AM +0100, Robin Murphy wrote:
> Hi Russell,
>
> On 03/06/16 08:58, Russell King wrote:
> >Convert DT component matching to use component_match_add_release().
> >
> >Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> >---
> > drivers/gpu/drm/arm/hdlcd_drv.c | 10 ++++++++--
> > drivers/gpu/drm/armada/armada_drv.c | 9 +++++++--
> > drivers/gpu/drm/drm_of.c | 13 +++++++++----
> > drivers/gpu/drm/msm/msm_drv.c | 8 +++++++-
> > drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 13 ++++++++++---
> > drivers/gpu/drm/sti/sti_drv.c | 9 +++++++--
> > drivers/gpu/drm/tilcdc/tilcdc_external.c | 9 +++++++--
> > 7 files changed, 55 insertions(+), 16 deletions(-)
> >
> >diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
> >index b987c63ba8d6..bbde48c4f550 100644
> >--- a/drivers/gpu/drm/arm/hdlcd_drv.c
> >+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
> >@@ -443,11 +443,16 @@ static const struct component_master_ops hdlcd_master_ops = {
> > .unbind = hdlcd_drm_unbind,
> > };
> >
> >-static int compare_dev(struct device *dev, void *data)
> >+static int compare_of(struct device *dev, void *data)
> > {
> > return dev->of_node == data;
> > }
> >
> >+static void release_of(struct device *dev, void *data)
> >+{
> >+ of_node_put(data);
> >+}
>
> Considering that there's 7 identical copies of this function in this patch
> alone, perhaps there's some mileage in defining it commonly as a static
> __maybe_unused default_release_of() in component.h or drm_of.h (and maybe
> default_compare_of() similarly)?
>
> (Apologies if there's already been some strong argument against that which
> I've not seen, but it seems like a reasonable thing to do.)
What we could do is extract out the common bits of OF-component matching
into drivers/of/of_component.c and make the whole thing a tad better.
I'll send a v2 series threaded to this message.
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
next prev parent reply other threads:[~2016-06-03 14:15 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-03 7:58 [PATCH] drm: convert DT component matching to component_match_add_release() Russell King
2016-06-03 9:40 ` Liviu Dudau
2016-06-03 10:36 ` Russell King - ARM Linux
2016-06-03 11:19 ` Liviu Dudau
2016-06-03 11:48 ` Russell King - ARM Linux
2016-06-03 10:56 ` Robin Murphy
2016-06-03 14:15 ` Russell King - ARM Linux [this message]
2016-06-03 14:21 ` [PATCH v2 1/3] of: add common OF-based component functionality Russell King
2016-06-03 15:29 ` Rob Herring
2016-06-03 15:36 ` Russell King - ARM Linux
2016-06-03 19:52 ` Rob Herring
2016-06-03 15:44 ` Thierry Reding
2016-06-03 16:11 ` Russell King - ARM Linux
2016-06-03 14:21 ` [PATCH v2 2/3] drm: convert DT component matching to component_match_add_release() Russell King
2016-06-03 15:10 ` Lucas Stach
2016-06-07 13:39 ` Liviu Dudau
2016-06-07 14:26 ` Vincent ABRIOU
2016-06-03 14:21 ` [PATCH v2 3/3] iommu: " Russell King
2016-06-03 15:20 ` Matthias Brugger
2016-06-15 13:31 ` Joerg Roedel
-- strict thread matches above, loose matches on Subject: below --
2016-10-19 10:28 [PATCH] drm: " Russell King
2016-10-20 6:36 ` Daniel Vetter
2016-10-20 20:39 ` Sean Paul
2016-10-20 21:50 ` Russell King - ARM Linux
2016-10-20 23:15 ` Sean Paul
2016-10-21 15:23 ` Russell King - ARM Linux
2016-10-24 13:21 ` Jyri Sarha
2016-10-25 16:44 ` Sean Paul
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=20160603141548.GC1041@n2100.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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).