commented early_printk patch because of rejects.
[linux-flexiantxendom0-3.2.10.git] / drivers / block / paride / pf.c
index fb0d28e..1e430e5 100644 (file)
@@ -770,7 +770,7 @@ static int pf_ready(void)
        return (((status_reg(pf_current) & (STAT_BUSY | pf_mask)) == pf_mask));
 }
 
-static struct request_queue pf_queue;
+static struct request_queue *pf_queue;
 
 static void do_pf_request(request_queue_t * q)
 {
@@ -834,7 +834,7 @@ static inline void next_request(int success)
        spin_lock_irqsave(&pf_spin_lock, saved_flags);
        end_request(pf_req, success);
        pf_busy = 0;
-       do_pf_request(&pf_queue);
+       do_pf_request(pf_queue);
        spin_unlock_irqrestore(&pf_spin_lock, saved_flags);
 }
 
@@ -960,9 +960,16 @@ static int __init pf_init(void)
                        put_disk(pf->disk);
                return -1;
        }
-       blk_init_queue(&pf_queue, do_pf_request, &pf_spin_lock);
-       blk_queue_max_phys_segments(&pf_queue, cluster);
-       blk_queue_max_hw_segments(&pf_queue, cluster);
+       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;
+       }
+
+       blk_queue_max_phys_segments(pf_queue, cluster);
+       blk_queue_max_hw_segments(pf_queue, cluster);
 
        for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) {
                struct gendisk *disk = pf->disk;
@@ -970,7 +977,7 @@ static int __init pf_init(void)
                if (!pf->present)
                        continue;
                disk->private_data = pf;
-               disk->queue = &pf_queue;
+               disk->queue = pf_queue;
                add_disk(disk);
        }
        return 0;
@@ -988,7 +995,7 @@ static void __exit pf_exit(void)
                put_disk(pf->disk);
                pi_release(pf->pi);
        }
-       blk_cleanup_queue(&pf_queue);
+       blk_cleanup_queue(pf_queue);
 }
 
 MODULE_LICENSE("GPL");