sound/core/isadma.c

Source file repositories/reference/linux-study-clean/sound/core/isadma.c

File Facts

System
Linux kernel
Corpus path
sound/core/isadma.c
Extension
.c
Size
3229 bytes
Lines
139
Domain
Driver Families
Bucket
sound/core
Inferred role
Driver Families: exported/initcall integration point
Status
integration implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct snd_dma_data {
	int dma;
};

static void __snd_release_dma(struct device *dev, void *data)
{
	struct snd_dma_data *p = data;

	snd_dma_disable(p->dma);
	free_dma(p->dma);
}

/**
 * snd_devm_request_dma - the managed version of request_dma()
 * @dev: the device pointer
 * @dma: the dma number
 * @name: the name string of the requester
 *
 * The requested DMA will be automatically released at unbinding via devres.
 *
 * Return: zero on success, or a negative error code
 */
int snd_devm_request_dma(struct device *dev, int dma, const char *name)
{
	struct snd_dma_data *p;

	if (request_dma(dma, name))
		return -EBUSY;
	p = devres_alloc(__snd_release_dma, sizeof(*p), GFP_KERNEL);
	if (!p) {
		free_dma(dma);
		return -ENOMEM;
	}
	p->dma = dma;
	devres_add(dev, p);
	return 0;
}
EXPORT_SYMBOL_GPL(snd_devm_request_dma);

Annotation

Implementation Notes