diff options
author | Alex Elder <elder@linaro.org> | 2016-06-03 15:55:30 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-06-03 17:03:23 -0700 |
commit | 76639ef579012a1276043ed765a14170997155b2 (patch) | |
tree | 31e1a33e5b2f8b1ff54d74b14aec57392c89ca62 /drivers/staging/greybus/bundle.c | |
parent | e5f23c45841ff371e4e515e8c5395fc659017930 (diff) | |
download | op-kernel-dev-76639ef579012a1276043ed765a14170997155b2.zip op-kernel-dev-76639ef579012a1276043ed765a14170997155b2.tar.gz |
greybus: define BUNDLE_ID_NONE
Define a bundle ID that means "no bundle". This will be used for
tracing connection events during the portion of a connection's
lifetime when it has no bundle associated with it. Don't allow
any bundle to be created using that ID.
Signed-off-by: Alex Elder <elder@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@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.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/greybus/bundle.c b/drivers/staging/greybus/bundle.c index 1810b62..e7c00b6 100644 --- a/drivers/staging/greybus/bundle.c +++ b/drivers/staging/greybus/bundle.c @@ -102,6 +102,11 @@ struct gb_bundle *gb_bundle_create(struct gb_interface *intf, u8 bundle_id, { struct gb_bundle *bundle; + if (bundle_id == BUNDLE_ID_NONE) { + dev_err(&intf->dev, "can't use bundle id %u\n", bundle_id); + return NULL; + } + /* * Reject any attempt to reuse a bundle id. We initialize * these serially, so there's no need to worry about keeping |