Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit adf318a0 authored by Chandana Kishori Chiluveru's avatar Chandana Kishori Chiluveru
Browse files

usb: gadget: f_uac1: free audio device card on USB disconnect



Driver opens audio sound device card on USB connect and
does not close on disconnect. When next time connect happens
driver checking for sound device card and returns if already
exist and causing issue on next connect. Hence fix this issue
by freeing the device card during disconnect.

Change-Id: I46f9a353f73b6d4f2297ad064f352f50f293a1d0
Signed-off-by: default avatarChandana Kishori Chiluveru <cchiluve@codeaurora.org>
parent a747ee15
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
/*
/*
 * u_uac1.c -- ALSA audio utilities for Gadget stack
 * u_uac1.c -- ALSA audio utilities for Gadget stack
 *
 *
 * Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
 * Copyright (C) 2008 Bryan Wu <cooloney@kernel.org>
 * Copyright (C) 2008 Bryan Wu <cooloney@kernel.org>
 * Copyright (C) 2008 Analog Devices, Inc
 * Copyright (C) 2008 Analog Devices, Inc
 *
 *
@@ -699,6 +699,7 @@ static int gaudio_close_snd_dev(struct gaudio *gau)
		filp_close(snd->filp, NULL);
		filp_close(snd->filp, NULL);
		snd->filp = NULL;
		snd->filp = NULL;
	}
	}
	snd->card = NULL;


	/* Close PCM playback device and setup substream */
	/* Close PCM playback device and setup substream */
	snd = &gau->playback;
	snd = &gau->playback;
@@ -706,6 +707,7 @@ static int gaudio_close_snd_dev(struct gaudio *gau)
		filp_close(snd->filp, NULL);
		filp_close(snd->filp, NULL);
		snd->filp = NULL;
		snd->filp = NULL;
	}
	}
	snd->card = NULL;


	/* Close PCM capture device and setup substream */
	/* Close PCM capture device and setup substream */
	snd = &gau->capture;
	snd = &gau->capture;
@@ -713,6 +715,7 @@ static int gaudio_close_snd_dev(struct gaudio *gau)
		filp_close(snd->filp, NULL);
		filp_close(snd->filp, NULL);
		snd->filp = NULL;
		snd->filp = NULL;
	}
	}
	snd->card = NULL;


	return 0;
	return 0;
}
}