]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/block/paride/pf.c
Merge branch 'for_paulus' of master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc
[linux-2.6-omap-h63xx.git] / drivers / block / paride / pf.c
index 852b564e903a69566a1f3b82d3a339d884db9b98..ceffa6034e2044f81340a3fadb2241f9053d0abf 100644 (file)
@@ -154,7 +154,7 @@ enum {D_PRT, D_PRO, D_UNI, D_MOD, D_SLV, D_LUN, D_DLY};
 #include <linux/blkpg.h>
 #include <asm/uaccess.h>
 
-static spinlock_t pf_spin_lock;
+static DEFINE_SPINLOCK(pf_spin_lock);
 
 module_param(verbose, bool, 0644);
 module_param(major, int, 0);
@@ -202,7 +202,7 @@ module_param_array(drive3, int, NULL, 0);
 #define ATAPI_WRITE_10         0x2a
 
 static int pf_open(struct inode *inode, struct file *file);
-static void do_pf_request(request_queue_t * q);
+static void do_pf_request(struct request_queue * q);
 static int pf_ioctl(struct inode *inode, struct file *file,
                    unsigned int cmd, unsigned long arg);
 static int pf_getgeo(struct block_device *bdev, struct hd_geometry *geo);
@@ -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
@@ -760,7 +760,7 @@ static void pf_end_request(int uptodate)
        }
 }
 
-static void do_pf_request(request_queue_t * q)
+static void do_pf_request(struct request_queue * q)
 {
        if (pf_busy)
                return;
@@ -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);