linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] driver-core: Implement device_match_always()
@ 2016-06-06  7:32 Thierry Reding
  2016-06-06  7:32 ` [PATCH 2/3] PCI: Use device_match_always() Thierry Reding
  2016-06-06  7:32 ` [PATCH 3/3] scsi: " Thierry Reding
  0 siblings, 2 replies; 5+ messages in thread
From: Thierry Reding @ 2016-06-06  7:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Bjorn Helgaas, James E . J . Bottomley, Martin K . Petersen,
	linux-pci, linux-scsi, linux-kernel

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-10 16:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-06  7:32 [PATCH 1/3] driver-core: Implement device_match_always() Thierry Reding
2016-06-06  7:32 ` [PATCH 2/3] PCI: Use device_match_always() Thierry Reding
2016-06-10 16:13   ` Bjorn Helgaas
2016-06-10 16:33     ` Thierry Reding
2016-06-06  7:32 ` [PATCH 3/3] scsi: " Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).