summaryrefslogtreecommitdiffstats
path: root/include/of_device.h
diff options
context:
space:
mode:
authorOleksij Rempel <o.rempel@pengutronix.de>2020-08-20 09:34:46 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-08-24 08:48:36 +0200
commita78113f9acca7ddb0a9058dc840fc6bba0c21d24 (patch)
tree3ef6d6126d072ab4c99c5e95a754a574cc448e0c /include/of_device.h
parente8e24151f2254832d0462528ca722d7c4d261a81 (diff)
downloadbarebox-a78113f9acca7ddb0a9058dc840fc6bba0c21d24.tar.gz
barebox-a78113f9acca7ddb0a9058dc840fc6bba0c21d24.tar.xz
of: of_device_get_match_compatible() helper
Some times we need to know, against which compatible did the driver was registered. So, instead of coding it in the driver, add generic helper for all drivers. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/of_device.h')
-rw-r--r--include/of_device.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/of_device.h b/include/of_device.h
index 244f5fcbbb..cef6d5b5cc 100644
--- a/include/of_device.h
+++ b/include/of_device.h
@@ -22,6 +22,7 @@ static inline int of_driver_match_device(struct device_d *dev,
}
extern const void *of_device_get_match_data(const struct device_d *dev);
+extern const char *of_device_get_match_compatible(const struct device_d *dev);
#else /* CONFIG_OFTREE */
@@ -36,6 +37,11 @@ static inline const void *of_device_get_match_data(const struct device_d *dev)
return NULL;
}
+static inline const char *of_device_get_match_compatible(const struct device_d *dev)
+{
+ return NULL;
+}
+
static inline const struct of_device_id *__of_match_device(
const struct of_device_id *matches, const struct device_d *dev)
{