[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230609152507.77649-3-andriy.shevchenko@linux.intel.com>
Date: Fri, 9 Jun 2023 18:25:06 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Serge Semin <Sergey.Semin@...kalelectronics.ru>,
Damien Le Moal <dlemoal@...nel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-ide@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-acpi@...r.kernel.org
Cc: Hans de Goede <hdegoede@...hat.com>, Jens Axboe <axboe@...nel.dk>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Len Brown <lenb@...nel.org>,
Daniel Scally <djrscally@...il.com>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>
Subject: [PATCH v1 2/3] device property: Implement device_is_compatible()
Some users want to use the struct device pointer to see if
the device is compatible. Provide inline helpers for them.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
include/linux/property.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/linux/property.h b/include/linux/property.h
index 695053c60306..8de2c707818a 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -85,6 +85,11 @@ bool fwnode_device_is_compatible(const struct fwnode_handle *fwnode, const char
return fwnode_property_match_string(fwnode, "compatible", compat) >= 0;
}
+static inline bool device_is_compatible(const struct device *dev, const char *compat)
+{
+ return fwnode_device_is_compatible(dev_fwnode(dev), compat);
+}
+
int fwnode_property_get_reference_args(const struct fwnode_handle *fwnode,
const char *prop, const char *nargs_prop,
unsigned int nargs, unsigned int index,
--
2.40.0.1.gaa8946217a0b
Powered by blists - more mailing lists