public inbox for linux-mediatek@lists.infradead.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	linux-acpi@vger.kernel.org, linux-media@vger.kernel.org,
	Paul Elder <paul.elder@ideasonboard.com>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Julien Stephan <jstephan@baylibre.com>,
	devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org
Subject: Re: [PATCH 1/1] device property: Add fwnode_name_eq()
Date: Tue, 31 Oct 2023 17:19:09 +0000	[thread overview]
Message-ID: <ZUE3Dbq2p8JZGeE1@kekkonen.localdomain> (raw)
In-Reply-To: <ZUEsEQQTTlXmOHPt@smile.fi.intel.com>

Hi Andy,

On Tue, Oct 31, 2023 at 06:32:17PM +0200, Andy Shevchenko wrote:
> On Tue, Oct 31, 2023 at 03:53:06PM +0200, Sakari Ailus wrote:
> > Add fwnode_name_eq() to implement the functionality of of_node_name_eq()
> > on fwnode property API. The same convention of ending the comparison at
> > '@' (besides '\0') is applied on also both ACPI and swnode. The function
> > is intended for comparing unit address-less node names on DT and firmware
> > or swnodes compliant with DT bindings.
> 
> Some comments below.
> 
> ...
> 
> > Would you be able to use this to replace of_node_name_eq()?
> 
> Can you point out to the use case? Maybe it can be rewritten using existing
> APIs?

Parsing DT for THine THP7321 ISP:
<URL:https://lore.kernel.org/linux-media/20231030133247.11243-1-laurent.pinchart@ideasonboard.com/T/#t>.

The driver shouldn't be bothered with separating the node name from the
unit address (separated by '@').

> 
> ...
> 
> > +	len = strchrnul(node_name, '@') - node_name;
> 
> > +	return strlen(name) == len && !strncmp(node_name, name, len);
> 
> Seems like this is reimplementation of str_has_prefix().
> 
> 	len = strchrnul(node_name, '@') - node_name;
> 	return str_has_prefix(node_name, name) == len;

I'll use this in v2.

-- 
Regards,

Sakari Ailus


  reply	other threads:[~2023-10-31 17:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-31 13:53 [PATCH 1/1] device property: Add fwnode_name_eq() Sakari Ailus
2023-10-31 16:32 ` Andy Shevchenko
2023-10-31 17:19   ` Sakari Ailus [this message]
2023-10-31 21:49 ` kernel test robot

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=ZUE3Dbq2p8JZGeE1@kekkonen.localdomain \
    --to=sakari.ailus@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jstephan@baylibre.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=paul.elder@ideasonboard.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