All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] dm: core: allow drivers to refuse to bind
@ 2016-04-19 22:19 Stephen Warren
  2016-04-19 22:19 ` [U-Boot] [PATCH 2/2] video: tegra: refuse to bind to disabled dcs Stephen Warren
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Stephen Warren @ 2016-04-19 22:19 UTC (permalink / raw)
  To: u-boot

From: Stephen Warren <swarren@nvidia.com>

In some cases, drivers may not want to bind to a device. Allow bind() to
return -ENODEV in this case, and don't treat this as an error. This can
be useful in situations where some information source other than the DT
node's main status property indicates whether the device should be
enabled, for example other DT properties might indicate this, or the
driver might query non-DT sources such as system fuses or a version number
register.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 drivers/core/lists.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/core/lists.c b/drivers/core/lists.c
index c4fc216340d8..a72db13a119a 100644
--- a/drivers/core/lists.c
+++ b/drivers/core/lists.c
@@ -171,6 +171,10 @@ int lists_bind_fdt(struct udevice *parent, const void *blob, int offset,
 
 		dm_dbg("   - found match at '%s'\n", entry->name);
 		ret = device_bind(parent, entry, name, NULL, offset, &dev);
+		if (ret == -ENODEV) {
+			dm_dbg("Driver '%s' refuses to bind\n", entry->name);
+			continue;
+		}
 		if (ret) {
 			dm_warn("Error binding driver '%s': %d\n", entry->name,
 				ret);
-- 
2.8.1

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

end of thread, other threads:[~2016-05-07 19:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-19 22:19 [U-Boot] [PATCH 1/2] dm: core: allow drivers to refuse to bind Stephen Warren
2016-04-19 22:19 ` [U-Boot] [PATCH 2/2] video: tegra: refuse to bind to disabled dcs Stephen Warren
2016-04-20 12:49   ` Thierry Reding
2016-04-20 13:16   ` Simon Glass
2016-05-07 19:03     ` Simon Glass
2016-04-20 14:42 ` [U-Boot] [PATCH 1/2] dm: core: allow drivers to refuse to bind Simon Glass
2016-05-04 18:57 ` Stephen Warren
2016-05-04 19:31   ` Simon Glass
2016-05-04 19:46     ` Stephen Warren
2016-05-04 19:48       ` Simon Glass
2016-05-04 20:02         ` Stephen Warren
2016-05-04 20:09           ` Simon Glass
2016-05-07 19:02             ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.