greybus: svc: clean up svc initialisation
authorJohan Hovold <johan@hovoldconsulting.com>
Wed, 25 Nov 2015 14:59:07 +0000 (15:59 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 25 Nov 2015 23:30:03 +0000 (15:30 -0800)
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>
drivers/staging/greybus/svc.c

index 8f4efb340f96717c340ff7d07ac7a2f88bba8683..5aa21f7c591df26f473e34bd5bd5d5e6523bb0cd 100644 (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);
 
+       ida_init(&svc->device_id_map);
        svc->state = GB_SVC_STATE_RESET;
        svc->connection = connection;
        connection->private = svc;
@@ -708,8 +709,6 @@ static int gb_svc_connection_init(struct gb_connection *connection)
        WARN_ON(connection->hd->initial_svc_connection);
        connection->hd->initial_svc_connection = connection;
 
-       ida_init(&svc->device_id_map);
-
        return 0;
 }