Commit bc942083 authored by Alex Elder's avatar Alex Elder Committed by Greg Kroah-Hartman

greybus: bundle: refactor gb_bundle_find()

Rearrange gb_bundle_find() so it follows the pattern used by
gb_connection_find().
Signed-off-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 52e8ce31
......@@ -283,13 +283,13 @@ struct gb_bundle *gb_bundle_find(struct gb_interface *intf, u8 bundle_id)
spin_lock_irq(&gb_bundles_lock);
list_for_each_entry(bundle, &intf->bundles, links)
if (bundle->id == bundle_id) {
spin_unlock_irq(&gb_bundles_lock);
return bundle;
}
if (bundle->id == bundle_id)
goto found;
bundle = NULL;
found:
spin_unlock_irq(&gb_bundles_lock);
return NULL;
return bundle;
}
static int gb_bundle_connections_init(struct gb_bundle *bundle)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment