Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1414705 > unrolled thread

[PATCH 1/3] driver-core: Implement device_match_always()

Started byThierry Reding <thierry.reding@gmail.com>
First post2016-06-06 09:40 +0200
Last post2016-06-06 09:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/3] driver-core: Implement device_match_always() Thierry Reding <thierry.reding@gmail.com> - 2016-06-06 09:40 +0200

#1414705 — [PATCH 1/3] driver-core: Implement device_match_always()

FromThierry Reding <thierry.reding@gmail.com>
Date2016-06-06 09:40 +0200
Subject[PATCH 1/3] driver-core: Implement device_match_always()
Message-ID<rGXiG-1OJ-9@gated-at.bofh.it>
From: Thierry Reding <treding@nvidia.com>

This is a helper function that can be used in iterators, such as
bus_find_device(), and will always match. This is useful to implement a
custom iterator interface on top of bus_find_device() or to check if any
devices have been registered at all.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 include/linux/device.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/device.h b/include/linux/device.h
index 38f02814d53a..bea9566cea96 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -1031,6 +1031,11 @@ extern int device_online(struct device *dev);
 extern void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode);
 extern void set_secondary_fwnode(struct device *dev, struct fwnode_handle *fwnode);
 
+static inline int device_match_always(struct device *device, void *data)
+{
+	return 1;
+}
+
 /*
  * Root device objects for grouping under /sys/devices
  */
-- 
2.8.3

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web