sound/pci/riptide/riptide.c

Source file repositories/reference/linux-study-clean/sound/pci/riptide/riptide.c

File Facts

System
Linux kernel
Corpus path
sound/pci/riptide/riptide.c
Extension
.c
Size
62866 bytes
Lines
2173
Domain
Driver Families
Bucket
sound/pci
Inferred role
Driver Families: operation-table or driver-model contract
Status
pattern 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

static struct pci_driver driver = {
	.name = KBUILD_MODNAME,
	.id_table = snd_riptide_ids,
	.probe = snd_card_riptide_probe,
	.driver = {
		.pm = &riptide_pm,
	},
};

#ifdef SUPPORT_JOYSTICK
static struct pci_driver joystick_driver = {
	.name = KBUILD_MODNAME "-joystick",
	.id_table = snd_riptide_joystick_ids,
	.probe = snd_riptide_joystick_probe,
	.remove = snd_riptide_joystick_remove,
};
#endif

static int __init alsa_card_riptide_init(void)
{
	int err;
	err = pci_register_driver(&driver);
	if (err < 0)
		return err;
#if defined(SUPPORT_JOYSTICK)
	err = pci_register_driver(&joystick_driver);
	/* On failure unregister formerly registered audio driver */
	if (err < 0)
		pci_unregister_driver(&driver);
#endif
	return err;
}

static void __exit alsa_card_riptide_exit(void)
{
	pci_unregister_driver(&driver);
#if defined(SUPPORT_JOYSTICK)
	pci_unregister_driver(&joystick_driver);
#endif
}

module_init(alsa_card_riptide_init);
module_exit(alsa_card_riptide_exit);

Annotation

Implementation Notes