From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Soha Jin <soha@lohu.info>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Daniel Scally <djrscally@gmail.com>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] device property: add fwnode_is_compatible() for compatible match
Date: Sun, 9 Oct 2022 20:26:05 +0200 [thread overview]
Message-ID: <Y0MSPaZlhW6iOYEV@kroah.com> (raw)
In-Reply-To: <20221009162155.1318-4-soha@lohu.info>
On Mon, Oct 10, 2022 at 12:21:55AM +0800, Soha Jin wrote:
> fwnode_is_compatible is a shortcut to check if a device is compatible with
> a compat string in fwnode property "compatible". This function is similar
> to of_device_is_compatible.
>
> Signed-off-by: Soha Jin <soha@lohu.info>
> ---
> include/linux/property.h | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/include/linux/property.h b/include/linux/property.h
> index dbe747f3e3be..776e4a8bc379 100644
> --- a/include/linux/property.h
> +++ b/include/linux/property.h
> @@ -252,6 +252,13 @@ fwnode_property_string_array_count(const struct fwnode_handle *fwnode,
> return fwnode_property_read_string_array(fwnode, propname, NULL, 0);
> }
>
> +static inline bool fwnode_is_compatible(const struct fwnode_handle *fwnode,
> + const char *compat)
> +{
> + return fwnode_property_match_string_nocase(fwnode, "compatible",
> + compat) >= 0;
Who would mistype "compatible" in a case insensitive way?
Why can't you fix the firmware to be correct instead of forcing the
operating system to fix it for them?
thanks,
greg k-h
next prev parent reply other threads:[~2022-10-09 18:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-09 16:21 [PATCH 0/3] Case-insensitive match_string and fwnode_is_compatible() Soha Jin
2022-10-09 16:21 ` [PATCH 1/3] string: add match_string_nocase() for case-insensitive match Soha Jin
2022-10-09 18:24 ` Greg Kroah-Hartman
2022-10-10 3:02 ` Soha Jin
2022-10-10 6:24 ` 'Greg Kroah-Hartman'
2022-10-10 7:36 ` Soha Jin
2022-10-09 16:21 ` [PATCH 2/3] device property: add {device,fwnode}_property_match_string_nocase() Soha Jin
2022-10-09 18:25 ` Greg Kroah-Hartman
2022-10-09 18:40 ` kernel test robot
2022-10-09 18:40 ` kernel test robot
2022-10-09 16:21 ` [PATCH 3/3] device property: add fwnode_is_compatible() for compatible match Soha Jin
2022-10-09 18:26 ` Greg Kroah-Hartman [this message]
2022-10-09 18:24 ` [PATCH 0/3] Case-insensitive match_string and fwnode_is_compatible() Greg Kroah-Hartman
2022-10-10 3:07 ` Soha Jin
2022-10-10 6:26 ` 'Greg Kroah-Hartman'
2022-10-10 7:40 ` Soha Jin
2022-10-10 6:23 ` Andy Shevchenko
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=Y0MSPaZlhW6iOYEV@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=djrscally@gmail.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=soha@lohu.info \
/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