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>
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;
};
#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);
* 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);
}