USB: gadget: midi: Replace snd_card_free with snd_card_free_closed
snd_card_free is a blocking function which waits for ALSA device to
be closed before freeing it. This could be blocked forever if userspace
has device node opened when midi function is unbound.
Replace it with snd_card_free_when_closed which can be safely used if
userspce has the device node opened.
It is not a blocking function and defers freeing of the card until
userspace closes the ALSA device.
Change-Id: I6becc44dc0f0c1131f9b7dcd1e4a151d830dde2b
CRs-fixed: 1116790
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
1 file changed