/**
 * fw_iso_resources_destroy - destroy a resource manager
 * @r: the resource manager that is no longer needed
 */
void fw_iso_resources_destroy(struct fw_iso_resources *r)
{
	WARN_ON(r->allocated);
	kfree(r->buffer);
	mutex_destroy(&r->mutex);
	fw_unit_put(r->unit);
}
Example #2
0
static void dg00x_free(struct snd_dg00x *dg00x)
{
	snd_dg00x_stream_destroy_duplex(dg00x);
	snd_dg00x_transaction_unregister(dg00x);

	fw_unit_put(dg00x->unit);

	mutex_destroy(&dg00x->mutex);
}
Example #3
0
static void tscm_free(struct snd_tscm *tscm)
{
	snd_tscm_transaction_unregister(tscm);
	snd_tscm_stream_destroy_duplex(tscm);

	fw_unit_put(tscm->unit);

	mutex_destroy(&tscm->mutex);
}
Example #4
0
static void bebob_free(struct snd_bebob *bebob)
{
	snd_bebob_stream_destroy_duplex(bebob);
	fw_unit_put(bebob->unit);

	kfree(bebob->maudio_special_quirk);

	mutex_destroy(&bebob->mutex);
	kfree(bebob);
}
Example #5
0
static void motu_free(struct snd_motu *motu)
{
	snd_motu_transaction_unregister(motu);

	snd_motu_stream_destroy_duplex(motu);
	fw_unit_put(motu->unit);

	mutex_destroy(&motu->mutex);
	kfree(motu);
}
Example #6
0
/*
 * This module releases the FireWire unit data after all ALSA character devices
 * are released by applications. This is for releasing stream data or finishing
 * transactions safely. Thus at returning from .remove(), this module still keep
 * references for the unit.
 */
static void
bebob_card_free(struct snd_card *card)
{
	struct snd_bebob *bebob = card->private_data;

	snd_bebob_stream_destroy_duplex(bebob);
	fw_unit_put(bebob->unit);

	kfree(bebob->maudio_special_quirk);

	if (bebob->card_index >= 0) {
		mutex_lock(&devices_mutex);
		clear_bit(bebob->card_index, devices_used);
		mutex_unlock(&devices_mutex);
	}

	mutex_destroy(&bebob->mutex);
}
Example #7
0
File: oxfw.c Project: 19Dan01/linux
/*
 * This module releases the FireWire unit data after all ALSA character devices
 * are released by applications. This is for releasing stream data or finishing
 * transactions safely. Thus at returning from .remove(), this module still keep
 * references for the unit.
 */
static void oxfw_card_free(struct snd_card *card)
{
	struct snd_oxfw *oxfw = card->private_data;
	unsigned int i;

	snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->rx_stream);
	if (oxfw->has_output)
		snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->tx_stream);

	fw_unit_put(oxfw->unit);

	for (i = 0; i < SND_OXFW_STREAM_FORMAT_ENTRIES; i++) {
		kfree(oxfw->tx_stream_formats[i]);
		kfree(oxfw->rx_stream_formats[i]);
	}

	mutex_destroy(&oxfw->mutex);
}
Example #8
0
static void oxfw_free(struct snd_oxfw *oxfw)
{
	unsigned int i;

	snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->rx_stream);
	if (oxfw->has_output)
		snd_oxfw_stream_destroy_simplex(oxfw, &oxfw->tx_stream);

	fw_unit_put(oxfw->unit);

	for (i = 0; i < SND_OXFW_STREAM_FORMAT_ENTRIES; i++) {
		kfree(oxfw->tx_stream_formats[i]);
		kfree(oxfw->rx_stream_formats[i]);
	}

	kfree(oxfw->spec);
	mutex_destroy(&oxfw->mutex);
}
Example #9
0
static void snd_ff_remove(struct fw_unit *unit)
{
	struct snd_ff *ff = dev_get_drvdata(&unit->device);

	/*
	 * Confirm to stop the work for registration before the sound card is
	 * going to be released. The work is not scheduled again because bus
	 * reset handler is not called anymore.
	 */
	cancel_work_sync(&ff->dwork.work);

	if (ff->registered) {
		// Block till all of ALSA character devices are released.
		snd_card_free(ff->card);
	}

	mutex_destroy(&ff->mutex);
	fw_unit_put(ff->unit);
}
Example #10
0
/*
 * This module releases the FireWire unit data after all ALSA character devices
 * are released by applications. This is for releasing stream data or finishing
 * transactions safely. Thus at returning from .remove(), this module still keep
 * references for the unit.
 */
static void
efw_card_free(struct snd_card *card)
{
	struct snd_efw *efw = card->private_data;

	snd_efw_stream_destroy_duplex(efw);
	snd_efw_transaction_remove_instance(efw);
	fw_unit_put(efw->unit);

	kfree(efw->resp_buf);

	if (efw->card_index >= 0) {
		mutex_lock(&devices_mutex);
		clear_bit(efw->card_index, devices_used);
		mutex_unlock(&devices_mutex);
	}

	mutex_destroy(&efw->mutex);
}
Example #11
0
/**
 * amdtp_out_stream_destroy - free stream resources
 * @s: the AMDTP output stream to destroy
 */
void amdtp_out_stream_destroy(struct amdtp_out_stream *s)
{
	WARN_ON(!IS_ERR(s->context));
	mutex_destroy(&s->mutex);
	fw_unit_put(s->unit);
}