aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/paride/pt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/paride/pt.c')
-rw-r--r--drivers/block/paride/pt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c
index 715ae5dc88fb..d2013d362403 100644
--- a/drivers/block/paride/pt.c
+++ b/drivers/block/paride/pt.c
@@ -943,7 +943,8 @@ static ssize_t pt_write(struct file *filp, const char __user *buf, size_t count,
943 943
944static int __init pt_init(void) 944static int __init pt_init(void)
945{ 945{
946 int unit, err = 0; 946 int unit;
947 int err;
947 948
948 if (disable) { 949 if (disable) {
949 err = -1; 950 err = -1;
@@ -955,14 +956,15 @@ static int __init pt_init(void)
955 goto out; 956 goto out;
956 } 957 }
957 958
958 if (register_chrdev(major, name, &pt_fops)) { 959 err = register_chrdev(major, name, &pt_fops);
960 if (err < 0) {
959 printk("pt_init: unable to get major number %d\n", major); 961 printk("pt_init: unable to get major number %d\n", major);
960 for (unit = 0; unit < PT_UNITS; unit++) 962 for (unit = 0; unit < PT_UNITS; unit++)
961 if (pt[unit].present) 963 if (pt[unit].present)
962 pi_release(pt[unit].pi); 964 pi_release(pt[unit].pi);
963 err = -1;
964 goto out; 965 goto out;
965 } 966 }
967 major = err;
966 pt_class = class_create(THIS_MODULE, "pt"); 968 pt_class = class_create(THIS_MODULE, "pt");
967 if (IS_ERR(pt_class)) { 969 if (IS_ERR(pt_class)) {
968 err = PTR_ERR(pt_class); 970 err = PTR_ERR(pt_class);