diff options
Diffstat (limited to 'drivers/block/DAC960.c')
-rw-r--r-- | drivers/block/DAC960.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c index c5f22bb0a48e..4e2c367fec11 100644 --- a/drivers/block/DAC960.c +++ b/drivers/block/DAC960.c | |||
@@ -79,23 +79,28 @@ static int DAC960_open(struct block_device *bdev, fmode_t mode) | |||
79 | struct gendisk *disk = bdev->bd_disk; | 79 | struct gendisk *disk = bdev->bd_disk; |
80 | DAC960_Controller_T *p = disk->queue->queuedata; | 80 | DAC960_Controller_T *p = disk->queue->queuedata; |
81 | int drive_nr = (long)disk->private_data; | 81 | int drive_nr = (long)disk->private_data; |
82 | int ret = -ENXIO; | ||
82 | 83 | ||
84 | lock_kernel(); | ||
83 | if (p->FirmwareType == DAC960_V1_Controller) { | 85 | if (p->FirmwareType == DAC960_V1_Controller) { |
84 | if (p->V1.LogicalDriveInformation[drive_nr]. | 86 | if (p->V1.LogicalDriveInformation[drive_nr]. |
85 | LogicalDriveState == DAC960_V1_LogicalDrive_Offline) | 87 | LogicalDriveState == DAC960_V1_LogicalDrive_Offline) |
86 | return -ENXIO; | 88 | goto out; |
87 | } else { | 89 | } else { |
88 | DAC960_V2_LogicalDeviceInfo_T *i = | 90 | DAC960_V2_LogicalDeviceInfo_T *i = |
89 | p->V2.LogicalDeviceInformation[drive_nr]; | 91 | p->V2.LogicalDeviceInformation[drive_nr]; |
90 | if (!i || i->LogicalDeviceState == DAC960_V2_LogicalDevice_Offline) | 92 | if (!i || i->LogicalDeviceState == DAC960_V2_LogicalDevice_Offline) |
91 | return -ENXIO; | 93 | goto out; |
92 | } | 94 | } |
93 | 95 | ||
94 | check_disk_change(bdev); | 96 | check_disk_change(bdev); |
95 | 97 | ||
96 | if (!get_capacity(p->disks[drive_nr])) | 98 | if (!get_capacity(p->disks[drive_nr])) |
97 | return -ENXIO; | 99 | goto out; |
98 | return 0; | 100 | ret = 0; |
101 | out: | ||
102 | unlock_kernel(); | ||
103 | return ret; | ||
99 | } | 104 | } |
100 | 105 | ||
101 | static int DAC960_getgeo(struct block_device *bdev, struct hd_geometry *geo) | 106 | static int DAC960_getgeo(struct block_device *bdev, struct hd_geometry *geo) |