aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/cpqarray.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/cpqarray.c')
-rw-r--r--drivers/block/cpqarray.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
index 3d967525e9a9..5d39df14ed90 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -156,9 +156,9 @@ static int sendcmd(
156 unsigned int blkcnt, 156 unsigned int blkcnt,
157 unsigned int log_unit ); 157 unsigned int log_unit );
158 158
159static int ida_open(struct inode *inode, struct file *filep); 159static int ida_open(struct block_device *bdev, fmode_t mode);
160static int ida_release(struct inode *inode, struct file *filep); 160static int ida_release(struct gendisk *disk, fmode_t mode);
161static int ida_ioctl(struct inode *inode, struct file *filep, unsigned int cmd, unsigned long arg); 161static int ida_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg);
162static int ida_getgeo(struct block_device *bdev, struct hd_geometry *geo); 162static int ida_getgeo(struct block_device *bdev, struct hd_geometry *geo);
163static int ida_ctlr_ioctl(ctlr_info_t *h, int dsk, ida_ioctl_t *io); 163static int ida_ctlr_ioctl(ctlr_info_t *h, int dsk, ida_ioctl_t *io);
164 164
@@ -197,7 +197,7 @@ static struct block_device_operations ida_fops = {
197 .owner = THIS_MODULE, 197 .owner = THIS_MODULE,
198 .open = ida_open, 198 .open = ida_open,
199 .release = ida_release, 199 .release = ida_release,
200 .ioctl = ida_ioctl, 200 .locked_ioctl = ida_ioctl,
201 .getgeo = ida_getgeo, 201 .getgeo = ida_getgeo,
202 .revalidate_disk= ida_revalidate, 202 .revalidate_disk= ida_revalidate,
203}; 203};
@@ -567,7 +567,12 @@ static int __init cpqarray_init(void)
567 num_cntlrs_reg++; 567 num_cntlrs_reg++;
568 } 568 }
569 569
570 return(num_cntlrs_reg); 570 if (num_cntlrs_reg)
571 return 0;
572 else {
573 pci_unregister_driver(&cpqarray_pci_driver);
574 return -ENODEV;
575 }
571} 576}
572 577
573/* Function to find the first free pointer into our hba[] array */ 578/* Function to find the first free pointer into our hba[] array */
@@ -818,12 +823,12 @@ DBGINFO(
818/* 823/*
819 * Open. Make sure the device is really there. 824 * Open. Make sure the device is really there.
820 */ 825 */
821static int ida_open(struct inode *inode, struct file *filep) 826static int ida_open(struct block_device *bdev, fmode_t mode)
822{ 827{
823 drv_info_t *drv = get_drv(inode->i_bdev->bd_disk); 828 drv_info_t *drv = get_drv(bdev->bd_disk);
824 ctlr_info_t *host = get_host(inode->i_bdev->bd_disk); 829 ctlr_info_t *host = get_host(bdev->bd_disk);
825 830
826 DBGINFO(printk("ida_open %s\n", inode->i_bdev->bd_disk->disk_name)); 831 DBGINFO(printk("ida_open %s\n", bdev->bd_disk->disk_name));
827 /* 832 /*
828 * Root is allowed to open raw volume zero even if it's not configured 833 * Root is allowed to open raw volume zero even if it's not configured
829 * so array config can still work. I don't think I really like this, 834 * so array config can still work. I don't think I really like this,
@@ -843,9 +848,9 @@ static int ida_open(struct inode *inode, struct file *filep)
843/* 848/*
844 * Close. Sync first. 849 * Close. Sync first.
845 */ 850 */
846static int ida_release(struct inode *inode, struct file *filep) 851static int ida_release(struct gendisk *disk, fmode_t mode)
847{ 852{
848 ctlr_info_t *host = get_host(inode->i_bdev->bd_disk); 853 ctlr_info_t *host = get_host(disk);
849 host->usage_count--; 854 host->usage_count--;
850 return 0; 855 return 0;
851} 856}
@@ -1128,10 +1133,10 @@ static int ida_getgeo(struct block_device *bdev, struct hd_geometry *geo)
1128 * ida_ioctl does some miscellaneous stuff like reporting drive geometry, 1133 * ida_ioctl does some miscellaneous stuff like reporting drive geometry,
1129 * setting readahead and submitting commands from userspace to the controller. 1134 * setting readahead and submitting commands from userspace to the controller.
1130 */ 1135 */
1131static int ida_ioctl(struct inode *inode, struct file *filep, unsigned int cmd, unsigned long arg) 1136static int ida_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, unsigned long arg)
1132{ 1137{
1133 drv_info_t *drv = get_drv(inode->i_bdev->bd_disk); 1138 drv_info_t *drv = get_drv(bdev->bd_disk);
1134 ctlr_info_t *host = get_host(inode->i_bdev->bd_disk); 1139 ctlr_info_t *host = get_host(bdev->bd_disk);
1135 int error; 1140 int error;
1136 ida_ioctl_t __user *io = (ida_ioctl_t __user *)arg; 1141 ida_ioctl_t __user *io = (ida_ioctl_t __user *)arg;
1137 ida_ioctl_t *my_io; 1142 ida_ioctl_t *my_io;
@@ -1165,7 +1170,7 @@ out_passthru:
1165 put_user(host->ctlr_sig, (int __user *)arg); 1170 put_user(host->ctlr_sig, (int __user *)arg);
1166 return 0; 1171 return 0;
1167 case IDAREVALIDATEVOLS: 1172 case IDAREVALIDATEVOLS:
1168 if (iminor(inode) != 0) 1173 if (MINOR(bdev->bd_dev) != 0)
1169 return -ENXIO; 1174 return -ENXIO;
1170 return revalidate_allvol(host); 1175 return revalidate_allvol(host);
1171 case IDADRIVERVERSION: 1176 case IDADRIVERVERSION: