]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
greybus: bundle: create GB_DEVICE_ID_BAD
authorGreg Kroah-Hartman <greg@kroah.com>
Wed, 24 Dec 2014 21:01:39 +0000 (13:01 -0800)
committerGreg Kroah-Hartman <greg@kroah.com>
Fri, 2 Jan 2015 21:05:42 +0000 (13:05 -0800)
Use a "name" for when we don't have a valid device id yet, instead of a
magic value of 0xff.

Reported-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Reviewed-by: Alex Elder <elder@linaro.org>
drivers/staging/greybus/bundle.c
drivers/staging/greybus/bundle.h
drivers/staging/greybus/connection.c

index 973ea39dc40737bcb3aa3e4f5abbe99b66355130..96153c54a687f5d2c89c2c2c5ba4b82a22a4ed14 100644 (file)
@@ -91,9 +91,11 @@ struct gb_bundle *gb_bundle_create(struct gb_interface *intf, u8 interface_id)
 
        bundle->intf = intf;
        bundle->id = interface_id;
-       bundle->device_id = 0xff;       /* Invalid device id to start with */
        INIT_LIST_HEAD(&bundle->connections);
 
+       /* Invalid device id to start with */
+       bundle->device_id = GB_DEVICE_ID_BAD;
+
        /* Build up the bundle device structures and register it with the
         * driver core */
        bundle->dev.parent = &intf->dev;
index e11d456430effe6b1b4cf102f057a9a19095f83f..62969cf0fa1f75029a44ede255bb5eff1de231ad 100644 (file)
@@ -24,6 +24,8 @@ struct gb_bundle {
 };
 #define to_gb_bundle(d) container_of(d, struct gb_bundle, dev)
 
+#define GB_DEVICE_ID_BAD       0xff
+
 /* Greybus "private" definitions" */
 struct gb_bundle *gb_bundle_create(struct gb_interface *intf, u8 module_id);
 void gb_bundle_destroy(struct gb_interface *intf);
index 2f70837ff4fe104d6c61324c043cbdf616add32a..82b03c348239b5fa86237ef799495bd79748f5fd 100644 (file)
@@ -146,7 +146,7 @@ void gb_connection_bind_protocol(struct gb_connection *connection)
         * device, so bring up the connection at the same time.
         * */
        bundle = connection->bundle;
-       if (bundle->device_id != 0xff)
+       if (bundle->device_id != GB_DEVICE_ID_BAD)
                gb_connection_init(connection);
 }