greybus: svc: clean up svc initialisation

Make sure to initialise the svc device fully before adding it to the
host device.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Johan Hovold 2015-11-25 15:59:07 +01:00 committed by Greg Kroah-Hartman
parent efe6ef76ba
commit 6106e51b74
1 changed files with 1 additions and 2 deletions

View File

@ -699,6 +699,7 @@ static int gb_svc_connection_init(struct gb_connection *connection)
dev_set_name(&svc->dev, "%d-svc", hd->bus_id); dev_set_name(&svc->dev, "%d-svc", hd->bus_id);
ida_init(&svc->device_id_map);
svc->state = GB_SVC_STATE_RESET; svc->state = GB_SVC_STATE_RESET;
svc->connection = connection; svc->connection = connection;
connection->private = svc; connection->private = svc;
@ -708,8 +709,6 @@ static int gb_svc_connection_init(struct gb_connection *connection)
WARN_ON(connection->hd->initial_svc_connection); WARN_ON(connection->hd->initial_svc_connection);
connection->hd->initial_svc_connection = connection; connection->hd->initial_svc_connection = connection;
ida_init(&svc->device_id_map);
return 0; return 0;
} }