summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/bundle.c
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2015-06-12 10:21:10 -0500
committerGreg Kroah-Hartman <gregkh@google.com>2015-06-12 12:14:24 -0700
commitbc942083585da78a5287089023aebcc8952c21f4 (patch)
treebe0edc90c4887730c76cce14f77777c2f7721d7b /drivers/staging/greybus/bundle.c
parent52e8ce317fe51dea86777b164b63e41e50f8a7bf (diff)
downloadlinux-bc942083585da78a5287089023aebcc8952c21f4.tar.bz2
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>
Diffstat (limited to 'drivers/staging/greybus/bundle.c')
-rw-r--r--drivers/staging/greybus/bundle.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/greybus/bundle.c b/drivers/staging/greybus/bundle.c
index 6e9d03ac7e35..89568b2b0adf 100644
--- a/drivers/staging/greybus/bundle.c
+++ b/drivers/staging/greybus/bundle.c
@@ -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)