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:
parent
52e8ce317f
commit
bc94208358
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user