[PATCH 11/50] staging: most: core: add a match function for the bus

Christian Gromm christian.gromm at microchip.com
Tue Nov 21 14:04:45 UTC 2017


This patch adds the function most_match. It is needed to accociate
registered devices and drivers with the bus.

Signed-off-by: Christian Gromm <christian.gromm at microchip.com>
---
 drivers/staging/most/core.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c
index d8e3b88..dbd7258 100644
--- a/drivers/staging/most/core.c
+++ b/drivers/staging/most/core.c
@@ -762,11 +762,20 @@ static const struct attribute_group *aim_attr_groups[] = {
  *		     ___C O R E___
  */
 
+int most_match(struct device *dev, struct device_driver *drv)
+{
+	if (!strcmp(dev_name(dev), "most"))
+		return 0;
+	else
+		return 1;
+}
+
 /**
  * Instantiation of the MOST bus
  */
 static struct bus_type most_bus = {
 	.name = "most",
+	.match = most_match,
 };
 
 /**
-- 
2.7.4



More information about the devel mailing list