greybus: hd: Add API to release reserved CPorts
authorVaibhav Agarwal <vaibhav.agarwal@linaro.org>
Fri, 27 May 2016 05:19:23 +0000 (10:49 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 27 May 2016 18:27:28 +0000 (11:27 -0700)
commit29a822bdf77a0c2af5b556506f3cf3175a9a4a98
tree4ec904997a970e1bcf709f5d778aa79847d130d6
parentcb4c8441e5dac4994ab63c1426babda3102beda9
greybus: hd: Add API to release reserved CPorts

It is required to release all unique ids registered via ida_get_simple
to avoid any possible memory leak. cport_release() already exists with
special handling for ES2_CPORT_CDSI1, i.e. updating in_use flag without
removing associated ida.

So, added another API to release reserved cports CDSI0 and CDSI1. This
is intended to  be used only during es2_destroy().

Signed-off-by: Vaibhav Agarwal <vaibhav.agarwal@linaro.org>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/hd.c
drivers/staging/greybus/hd.h