aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/paride/pg.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/paride/pg.c')
-rw-r--r--drivers/block/paride/pg.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/block/paride/pg.c b/drivers/block/paride/pg.c
index 6f5df0fad703..79b868254032 100644
--- a/drivers/block/paride/pg.c
+++ b/drivers/block/paride/pg.c
@@ -643,7 +643,8 @@ static ssize_t pg_read(struct file *filp, char __user *buf, size_t count, loff_t
643 643
644static int __init pg_init(void) 644static int __init pg_init(void)
645{ 645{
646 int unit, err = 0; 646 int unit;
647 int err;
647 648
648 if (disable){ 649 if (disable){
649 err = -1; 650 err = -1;
@@ -657,16 +658,17 @@ static int __init pg_init(void)
657 goto out; 658 goto out;
658 } 659 }
659 660
660 if (register_chrdev(major, name, &pg_fops)) { 661 err = register_chrdev(major, name, &pg_fops);
662 if (err < 0) {
661 printk("pg_init: unable to get major number %d\n", major); 663 printk("pg_init: unable to get major number %d\n", major);
662 for (unit = 0; unit < PG_UNITS; unit++) { 664 for (unit = 0; unit < PG_UNITS; unit++) {
663 struct pg *dev = &devices[unit]; 665 struct pg *dev = &devices[unit];
664 if (dev->present) 666 if (dev->present)
665 pi_release(dev->pi); 667 pi_release(dev->pi);
666 } 668 }
667 err = -1;
668 goto out; 669 goto out;
669 } 670 }
671 major = err; /* In case the user specified `major=0' (dynamic) */
670 pg_class = class_create(THIS_MODULE, "pg"); 672 pg_class = class_create(THIS_MODULE, "pg");
671 if (IS_ERR(pg_class)) { 673 if (IS_ERR(pg_class)) {
672 err = PTR_ERR(pg_class); 674 err = PTR_ERR(pg_class);