/* XXX This could be per-host device or per-module */
static DEFINE_SPINLOCK(gb_bundles_lock);
-static int __bundle_bind_protocols(struct device *dev, void *data)
-{
- struct gb_bundle *bundle;
- struct gb_connection *connection;
-
- if (!is_gb_bundle(dev))
- return 0;
-
- bundle = to_gb_bundle(dev);
-
- list_for_each_entry(connection, &bundle->connections, bundle_links) {
- gb_connection_bind_protocol(connection);
- }
-
- return 0;
-}
-
-/*
- * Walk all bundles in the system, and see if any connections are not bound to a
- * specific prototcol. If they are not, then try to find one for it and bind it
- * to it.
- *
- * This is called after registering a new protocol.
- */
-void gb_bundle_bind_protocols(void)
-{
- bus_for_each_dev(&greybus_bus_type, NULL, NULL,
- __bundle_bind_protocols);
-}
-
/*
* Create a gb_bundle structure to represent a discovered
* bundle. Returns a pointer to the new bundle or a null
#include "greybus.h"
+
+static int gb_connection_bind_protocol(struct gb_connection *connection);
+
+
static DEFINE_SPINLOCK(gb_connections_lock);
/* This is only used at initialization time; no locking is required. */
}
EXPORT_SYMBOL_GPL(gb_connection_latency_tag_disable);
-int gb_connection_bind_protocol(struct gb_connection *connection)
+static int gb_connection_bind_protocol(struct gb_connection *connection)
{
struct gb_protocol *protocol;
int ret;
void greybus_data_rcvd(struct gb_host_device *hd, u16 cport_id,
u8 *data, size_t length);
-int gb_connection_bind_protocol(struct gb_connection *connection);
-
void gb_connection_latency_tag_enable(struct gb_connection *connection);
void gb_connection_latency_tag_disable(struct gb_connection *connection);
pr_info("Registered %s protocol.\n", protocol->name);
- /*
- * Go try to bind any unbound connections, as we have a
- * new protocol in the system
- */
- gb_bundle_bind_protocols();
-
return 0;
}
EXPORT_SYMBOL_GPL(__gb_protocol_register);