aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/vmur.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/char/vmur.c')
-rw-r--r--drivers/s390/char/vmur.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c
index 31b902e94f7b..77571b68539a 100644
--- a/drivers/s390/char/vmur.c
+++ b/drivers/s390/char/vmur.c
@@ -1026,9 +1026,15 @@ static int __init ur_init(void)
1026 1026
1027 debug_set_level(vmur_dbf, 6); 1027 debug_set_level(vmur_dbf, 6);
1028 1028
1029 vmur_class = class_create(THIS_MODULE, "vmur");
1030 if (IS_ERR(vmur_class)) {
1031 rc = PTR_ERR(vmur_class);
1032 goto fail_free_dbf;
1033 }
1034
1029 rc = ccw_driver_register(&ur_driver); 1035 rc = ccw_driver_register(&ur_driver);
1030 if (rc) 1036 if (rc)
1031 goto fail_free_dbf; 1037 goto fail_class_destroy;
1032 1038
1033 rc = alloc_chrdev_region(&dev, 0, NUM_MINORS, "vmur"); 1039 rc = alloc_chrdev_region(&dev, 0, NUM_MINORS, "vmur");
1034 if (rc) { 1040 if (rc) {
@@ -1038,18 +1044,13 @@ static int __init ur_init(void)
1038 } 1044 }
1039 ur_first_dev_maj_min = MKDEV(MAJOR(dev), 0); 1045 ur_first_dev_maj_min = MKDEV(MAJOR(dev), 0);
1040 1046
1041 vmur_class = class_create(THIS_MODULE, "vmur");
1042 if (IS_ERR(vmur_class)) {
1043 rc = PTR_ERR(vmur_class);
1044 goto fail_unregister_region;
1045 }
1046 pr_info("%s loaded.\n", ur_banner); 1047 pr_info("%s loaded.\n", ur_banner);
1047 return 0; 1048 return 0;
1048 1049
1049fail_unregister_region:
1050 unregister_chrdev_region(ur_first_dev_maj_min, NUM_MINORS);
1051fail_unregister_driver: 1050fail_unregister_driver:
1052 ccw_driver_unregister(&ur_driver); 1051 ccw_driver_unregister(&ur_driver);
1052fail_class_destroy:
1053 class_destroy(vmur_class);
1053fail_free_dbf: 1054fail_free_dbf:
1054 debug_unregister(vmur_dbf); 1055 debug_unregister(vmur_dbf);
1055 return rc; 1056 return rc;
@@ -1057,9 +1058,9 @@ fail_free_dbf:
1057 1058
1058static void __exit ur_exit(void) 1059static void __exit ur_exit(void)
1059{ 1060{
1060 class_destroy(vmur_class);
1061 unregister_chrdev_region(ur_first_dev_maj_min, NUM_MINORS); 1061 unregister_chrdev_region(ur_first_dev_maj_min, NUM_MINORS);
1062 ccw_driver_unregister(&ur_driver); 1062 ccw_driver_unregister(&ur_driver);
1063 class_destroy(vmur_class);
1063 debug_unregister(vmur_dbf); 1064 debug_unregister(vmur_dbf);
1064 pr_info("%s unloaded.\n", ur_banner); 1065 pr_info("%s unloaded.\n", ur_banner);
1065} 1066}