summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/connection.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2015-12-07 15:05:34 +0100
committerGreg Kroah-Hartman <gregkh@google.com>2015-12-08 15:31:14 -0500
commit0bf1f2441979e290945f4e5af40d76582c61da1e (patch)
tree9656af68832e9aa9594eac0acbbff2c64d5ae66a /drivers/staging/greybus/connection.c
parent36173112354a4f5993d464f95b04d41e1eec10a0 (diff)
downloadlinux-stable-0bf1f2441979e290945f4e5af40d76582c61da1e.tar.gz
linux-stable-0bf1f2441979e290945f4e5af40d76582c61da1e.tar.bz2
linux-stable-0bf1f2441979e290945f4e5af40d76582c61da1e.zip
greybus: connection: separate connection creation and enabling
Separate connection creation from enabling. This will ultimately allow connection structures to be created while parsing manifests, but the connections to not be enabled until a driver is bound. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/connection.c')
-rw-r--r--drivers/staging/greybus/connection.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c
index 980244a873b8..c93650268b99 100644
--- a/drivers/staging/greybus/connection.c
+++ b/drivers/staging/greybus/connection.c
@@ -14,7 +14,6 @@
static int gb_connection_bind_protocol(struct gb_connection *connection);
static void gb_connection_unbind_protocol(struct gb_connection *connection);
-static int gb_connection_init(struct gb_connection *connection);
static DEFINE_SPINLOCK(gb_connections_lock);
@@ -125,7 +124,6 @@ gb_connection_create(struct gb_host_device *hd, int hd_cport_id,
struct gb_connection *connection;
struct ida *id_map = &hd->cport_id_map;
int ida_start, ida_end;
- int retval;
u8 major = 0;
u8 minor = 1;
@@ -194,14 +192,6 @@ gb_connection_create(struct gb_host_device *hd, int hd_cport_id,
spin_unlock_irq(&gb_connections_lock);
- retval = gb_connection_init(connection);
- if (retval) {
- dev_err(&hd->dev, "%s: failed to initialize connection: %d\n",
- connection->name, retval);
- gb_connection_destroy(connection);
- return NULL;
- }
-
return connection;
err_free_connection:
@@ -396,7 +386,7 @@ static int gb_connection_protocol_get_version(struct gb_connection *connection)
return 0;
}
-static int gb_connection_init(struct gb_connection *connection)
+int gb_connection_init(struct gb_connection *connection)
{
int ret;