fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / block / paride / pf.c
index 852b564..7cdaa19 100644 (file)
@@ -707,7 +707,7 @@ static int pf_detect(void)
                        if (pi_init(pf->pi, 0, conf[D_PRT], conf[D_MOD],
                                    conf[D_UNI], conf[D_PRO], conf[D_DLY],
                                    pf_scratch, PI_PF, verbose, pf->name)) {
-                               if (!pf_probe(pf) && pf->disk) {
+                               if (pf->disk && !pf_probe(pf)) {
                                        pf->present = 1;
                                        k++;
                                } else
@@ -933,25 +933,25 @@ static int __init pf_init(void)
        int unit;
 
        if (disable)
-               return -1;
+               return -EINVAL;
 
        pf_init_units();
 
        if (pf_detect())
-               return -1;
+               return -ENODEV;
        pf_busy = 0;
 
        if (register_blkdev(major, name)) {
                for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++)
                        put_disk(pf->disk);
-               return -1;
+               return -EBUSY;
        }
        pf_queue = blk_init_queue(do_pf_request, &pf_spin_lock);
        if (!pf_queue) {
                unregister_blkdev(major, name);
                for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++)
                        put_disk(pf->disk);
-               return -1;
+               return -ENOMEM;
        }
 
        blk_queue_max_phys_segments(pf_queue, cluster);