drivers/video/fbdev/savage/savagefb_driver.c

Source file repositories/reference/linux-study-clean/drivers/video/fbdev/savage/savagefb_driver.c

File Facts

System
Linux kernel
Corpus path
drivers/video/fbdev/savage/savagefb_driver.c
Extension
.c
Size
66302 bytes
Lines
2584
Domain
Driver Families
Bucket
drivers/video
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 savagefb_driver = {
	.name =     "savagefb",
	.id_table = savagefb_devices,
	.probe =    savagefb_probe,
	.driver.pm = &savagefb_pm_ops,
	.remove =   savagefb_remove,
};

/* **************************** exit-time only **************************** */

static void __exit savage_done(void)
{
	DBG("savage_done");
	pci_unregister_driver(&savagefb_driver);
}


/* ************************* init in-kernel code ************************** */

static int __init savagefb_setup(char *options)
{
#ifndef MODULE
	char *this_opt;

	if (!options || !*options)
		return 0;

	while ((this_opt = strsep(&options, ",")) != NULL) {
		mode_option = this_opt;
	}
#endif /* !MODULE */
	return 0;
}

static int __init savagefb_init(void)
{
	char *option;

	DBG("savagefb_init");

	if (fb_modesetting_disabled("savagefb"))
		return -ENODEV;

	if (fb_get_options("savagefb", &option))
		return -ENODEV;

	savagefb_setup(option);
	return pci_register_driver(&savagefb_driver);

}

module_init(savagefb_init);
module_exit(savage_done);

module_param(mode_option, charp, 0);
MODULE_PARM_DESC(mode_option, "Specify initial video mode");

Annotation

Implementation Notes