mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-22 13:52:57 +00:00
[module] add logging for kvmfr_module_init
This commit is contained in:
parent
063a859de1
commit
9d5c543a53
1 changed files with 19 additions and 5 deletions
|
@ -557,25 +557,39 @@ static int __init kvmfr_module_init(void)
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
kvmfr = kzalloc(sizeof(struct kvmfr_info), GFP_KERNEL);
|
kvmfr = kzalloc(sizeof(struct kvmfr_info), GFP_KERNEL);
|
||||||
if (!kvmfr)
|
if (!kvmfr) {
|
||||||
|
printk(KERN_INFO "kvmfr: kvmfr_module_init: failed to allocate memory!\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
kvmfr->major = register_chrdev(0, KVMFR_DEV_NAME, &fops);
|
kvmfr->major = register_chrdev(0, KVMFR_DEV_NAME, &fops);
|
||||||
if (kvmfr->major < 0)
|
if (kvmfr->major < 0) {
|
||||||
|
printk(
|
||||||
|
KERN_INFO "kvmfr: kvmfr_module_init: failed to register char device!\n");
|
||||||
goto out_free;
|
goto out_free;
|
||||||
|
}
|
||||||
|
|
||||||
kvmfr->pClass = class_create(THIS_MODULE, KVMFR_DEV_NAME);
|
kvmfr->pClass = class_create(THIS_MODULE, KVMFR_DEV_NAME);
|
||||||
if (IS_ERR(kvmfr->pClass))
|
if (IS_ERR(kvmfr->pClass)) {
|
||||||
|
printk(KERN_INFO "kvmfr: kvmfr_module_init: failed to create class!\n");
|
||||||
goto out_unreg;
|
goto out_unreg;
|
||||||
|
}
|
||||||
|
|
||||||
ret = create_static_devices();
|
ret = create_static_devices();
|
||||||
if (ret < 0)
|
if (ret < 0) {
|
||||||
|
printk(
|
||||||
|
KERN_INFO "kvmfr: kvmfr_module_init: failed to create static devices!\n");
|
||||||
goto out_class_destroy;
|
goto out_class_destroy;
|
||||||
|
}
|
||||||
|
|
||||||
ret = pci_register_driver(&kvmfr_pci_driver);
|
ret = pci_register_driver(&kvmfr_pci_driver);
|
||||||
if (ret < 0)
|
if (ret < 0) {
|
||||||
|
printk(
|
||||||
|
KERN_INFO "kvmfr: kvmfr_module_init: failed to register pci driver!\n");
|
||||||
goto out_free_static;
|
goto out_free_static;
|
||||||
|
}
|
||||||
|
|
||||||
|
printk(KERN_INFO "kvmfr: kvmfr_module_init: module loaded\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out_free_static:
|
out_free_static:
|
||||||
|
|
Loading…
Reference in a new issue