ANDROID: GKI: Resolve ABI diff for struct snd_usb_audio

Adds member 'struct mutex dev_lock' to struct snd_usb_audio.

Test: build
Bug: 151372815
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Change-Id: I9aafd93924025e71ef1362ea225396593cd64872
(cherry picked from commit f055b3843f)
[hridya: partial cherry-pick from snapshot change]
Signed-off-by: Hridya Valsaraju <hridya@google.com>
This commit is contained in:
Hridya Valsaraju
2020-04-21 11:17:01 -07:00
parent e439c4e5a9
commit 5a23994ca3
3 changed files with 8 additions and 0 deletions

View File

@@ -430,6 +430,7 @@ static void snd_usb_audio_free(struct snd_card *card)
list_for_each_entry_safe(ep, n, &chip->ep_list, list)
snd_usb_endpoint_free(ep);
mutex_destroy(&chip->dev_lock);
mutex_destroy(&chip->mutex);
if (!atomic_read(&chip->shutdown))
dev_set_drvdata(&chip->dev->dev, NULL);
@@ -557,6 +558,7 @@ static int snd_usb_audio_create(struct usb_interface *intf,
chip = card->private_data;
mutex_init(&chip->mutex);
mutex_init(&chip->dev_lock);
init_waitqueue_head(&chip->shutdown_wait);
chip->index = idx;
chip->dev = dev;

View File

@@ -72,9 +72,14 @@ static void snd_usb_audio_stream_free(struct snd_usb_stream *stream)
static void snd_usb_audio_pcm_free(struct snd_pcm *pcm)
{
struct snd_usb_stream *stream = pcm->private_data;
struct snd_usb_audio *chip;
if (stream) {
mutex_lock(&stream->chip->dev_lock);
chip = stream->chip;
stream->pcm = NULL;
snd_usb_audio_stream_free(stream);
mutex_unlock(&chip->dev_lock);
}
}

View File

@@ -66,6 +66,7 @@ struct snd_usb_audio {
*/
struct usb_host_interface *ctrl_intf; /* the audio control interface */
struct mutex dev_lock; /* to protect any race with disconnect */
int card_num; /* cache pcm card number to use upon disconnect */
void (*disconnect_cb)(struct snd_usb_audio *chip); /* callback to cleanup on disconnect */
};