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

Commit 5b14ec25 authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Takashi Iwai
Browse files

ALSA: firewire: release reference count of firewire unit in .remove callback of bus driver



In a previous commit, drivers in ALSA firewire stack blocks .remove
callback of bus driver. This enables to release members of private
data in the callback after releasing device of sound card.

This commit simplifies codes to release the members.

Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 61ccc6f6
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -129,9 +129,6 @@ name_device(struct snd_bebob *bebob)
static void bebob_free(struct snd_bebob *bebob)
{
	snd_bebob_stream_destroy_duplex(bebob);

	mutex_destroy(&bebob->mutex);
	fw_unit_put(bebob->unit);
}

/*
@@ -376,10 +373,10 @@ static void bebob_remove(struct fw_unit *unit)
	if (bebob->registered) {
		// Block till all of ALSA character devices are released.
		snd_card_free(bebob->card);
	} else {
		/* Don't forget this case. */
		bebob_free(bebob);
	}

	mutex_destroy(&bebob->mutex);
	fw_unit_put(bebob->unit);
}

static const struct snd_bebob_rate_spec normal_rate_spec = {
+3 −6
Original line number Diff line number Diff line
@@ -126,9 +126,6 @@ static void dice_free(struct snd_dice *dice)
{
	snd_dice_stream_destroy_duplex(dice);
	snd_dice_transaction_destroy(dice);

	mutex_destroy(&dice->mutex);
	fw_unit_put(dice->unit);
}

/*
@@ -261,10 +258,10 @@ static void dice_remove(struct fw_unit *unit)
	if (dice->registered) {
		/* No need to wait for releasing card object in this context. */
		snd_card_free_when_closed(dice->card);
	} else {
		/* Don't forget this case. */
		dice_free(dice);
	}

	mutex_destroy(&dice->mutex);
	fw_unit_put(dice->unit);
}

static void dice_bus_reset(struct fw_unit *unit)
+3 −6
Original line number Diff line number Diff line
@@ -45,9 +45,6 @@ static void dg00x_free(struct snd_dg00x *dg00x)
{
	snd_dg00x_stream_destroy_duplex(dg00x);
	snd_dg00x_transaction_unregister(dg00x);

	mutex_destroy(&dg00x->mutex);
	fw_unit_put(dg00x->unit);
}

static void dg00x_card_free(struct snd_card *card)
@@ -174,10 +171,10 @@ static void snd_dg00x_remove(struct fw_unit *unit)
	if (dg00x->registered) {
		// Block till all of ALSA character devices are released.
		snd_card_free(dg00x->card);
	} else {
		/* Don't forget this case. */
		dg00x_free(dg00x);
	}

	mutex_destroy(&dg00x->mutex);
	fw_unit_put(dg00x->unit);
}

static const struct ieee1394_device_id snd_dg00x_id_table[] = {
+3 −6
Original line number Diff line number Diff line
@@ -31,9 +31,6 @@ static void ff_free(struct snd_ff *ff)
{
	snd_ff_stream_destroy_duplex(ff);
	snd_ff_transaction_unregister(ff);

	mutex_destroy(&ff->mutex);
	fw_unit_put(ff->unit);
}

static void ff_card_free(struct snd_card *card)
@@ -147,10 +144,10 @@ static void snd_ff_remove(struct fw_unit *unit)
	if (ff->registered) {
		// Block till all of ALSA character devices are released.
		snd_card_free(ff->card);
	} else {
		/* Don't forget this case. */
		ff_free(ff);
	}

	mutex_destroy(&ff->mutex);
	fw_unit_put(ff->unit);
}

static const struct snd_ff_spec spec_ff400 = {
+3 −6
Original line number Diff line number Diff line
@@ -188,9 +188,6 @@ static void efw_free(struct snd_efw *efw)
{
	snd_efw_stream_destroy_duplex(efw);
	snd_efw_transaction_remove_instance(efw);

	mutex_destroy(&efw->mutex);
	fw_unit_put(efw->unit);
}

/*
@@ -360,10 +357,10 @@ static void efw_remove(struct fw_unit *unit)
	if (efw->registered) {
		// Block till all of ALSA character devices are released.
		snd_card_free(efw->card);
	} else {
		/* Don't forget this case. */
		efw_free(efw);
	}

	mutex_destroy(&efw->mutex);
	fw_unit_put(efw->unit);
}

static const struct ieee1394_device_id efw_id_table[] = {
Loading