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

Commit f152dfee authored by Alexander Shishkin's avatar Alexander Shishkin
Browse files

intel_th: msu: Release resources on removal



Do release the resources when msu subdevice gets removed: stop the
capture if it is active (which is still possible even though the
module in pinned) and free the capture buffers.

Signed-off-by: default avatarAlexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: default avatarLaurent Fert <laurent.fert@intel.com>
parent 8e9a2beb
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1492,6 +1492,18 @@ static int intel_th_msc_probe(struct intel_th_device *thdev)

static void intel_th_msc_remove(struct intel_th_device *thdev)
{
	struct msc *msc = dev_get_drvdata(&thdev->dev);
	int ret;

	intel_th_msc_deactivate(thdev);

	/*
	 * Buffers should not be used at this point except if the
	 * output character device is still open and the parent
	 * device gets detached from its bus, which is a FIXME.
	 */
	ret = msc_buffer_free_unless_used(msc);
	WARN_ON_ONCE(ret);
}

static struct intel_th_driver intel_th_msc_driver = {