sound/soc/sdca/sdca_function_device.c

Source file repositories/reference/linux-study-clean/sound/soc/sdca/sdca_function_device.c

File Facts

System
Linux kernel
Corpus path
sound/soc/sdca/sdca_function_device.c
Extension
.c
Size
3376 bytes
Lines
136
Domain
Driver Families
Bucket
sound/soc
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

if (IS_ERR(func_dev)) {
			ret = PTR_ERR(func_dev);
			/*
			 * Unregister functions that were successfully
			 * registered before this failure. This also
			 * sets func_dev to NULL so the caller will not
			 * try to unregister them again.
			 */
			sdca_dev_unregister_functions(slave);
			return ret;
		}

		sdca_data->function[i].func_dev = func_dev;
	}

	return 0;
}
EXPORT_SYMBOL_NS(sdca_dev_register_functions, "SND_SOC_SDCA");

void sdca_dev_unregister_functions(struct sdw_slave *slave)
{
	struct sdca_device_data *sdca_data = &slave->sdca_data;
	int i;

	for (i = 0; i < sdca_data->num_functions; i++) {
		if (!sdca_data->function[i].func_dev)
			continue;

		sdca_dev_unregister(sdca_data->function[i].func_dev);
		sdca_data->function[i].func_dev = NULL;
	}
}
EXPORT_SYMBOL_NS(sdca_dev_unregister_functions, "SND_SOC_SDCA");

Annotation

Implementation Notes