greybus: bundle: refactor gb_bundle_find()

Rearrange gb_bundle_find() so it follows the pattern used by
gb_connection_find().

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Alex Elder 2015-06-12 10:21:10 -05:00 committed by Greg Kroah-Hartman
parent 52e8ce317f
commit bc94208358
1 changed files with 5 additions and 5 deletions

View File

@ -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)