Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1414780
| From | Thierry Reding <thierry.reding@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 01/22] of: Implement of_match_device() |
| Date | 2016-06-06 10:50 +0200 |
| Message-ID | <rGYoq-2vy-23@gated-at.bofh.it> (permalink) |
| References | <rGYeJ-2qH-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Thierry Reding <treding@nvidia.com>
Many drivers open-code a variant of this function to look up the device
representing a given device tree node. Provide a common implementation
that can be reused by all drivers to avoid duplication.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
drivers/gpu/drm/drm_mipi_dsi.c | 5 -----
include/linux/of_device.h | 5 +++++
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
index f5d80839a90c..37f95f3b2dd2 100644
--- a/drivers/gpu/drm/drm_mipi_dsi.c
+++ b/drivers/gpu/drm/drm_mipi_dsi.c
@@ -77,11 +77,6 @@ static struct bus_type mipi_dsi_bus_type = {
.pm = &mipi_dsi_device_pm_ops,
};
-static int of_device_match(struct device *dev, void *data)
-{
- return dev->of_node == data;
-}
-
/**
* of_find_mipi_dsi_device_by_node() - find the MIPI DSI device matching a
* device tree node
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index cc7dd687a89d..ada83eac2ae2 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -102,4 +102,9 @@ static inline void of_dma_configure(struct device *dev, struct device_node *np)
{}
#endif /* CONFIG_OF */
+static inline int of_device_match(struct device *dev, void *data)
+{
+ return dev->of_node == data;
+}
+
#endif /* _LINUX_OF_DEVICE_H */
--
2.8.3
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/22] of: Introduce of_match_device() Thierry Reding <thierry.reding@gmail.com> - 2016-06-06 10:50 +0200 [PATCH 01/22] of: Implement of_match_device() Thierry Reding <thierry.reding@gmail.com> - 2016-06-06 10:50 +0200 Re: [PATCH 00/22] of: Introduce of_match_device() Frank Rowand <frowand.list@gmail.com> - 2016-06-06 21:00 +0200
csiph-web