patch-2.4.14 linux/drivers/ide/ide.c
Next file: linux/drivers/ide/pdc202xx.c
Previous file: linux/drivers/ide/ide-pci.c
Back to the patch index
Back to the overall index
- Lines: 45
- Date:
Thu Oct 25 13:58:35 2001
- Orig file:
v2.4.13/linux/drivers/ide/ide.c
- Orig date:
Tue Oct 23 22:48:51 2001
diff -u --recursive --new-file v2.4.13/linux/drivers/ide/ide.c linux/drivers/ide/ide.c
@@ -1950,11 +1950,9 @@
static int ide_open (struct inode * inode, struct file * filp)
{
ide_drive_t *drive;
- int rc;
if ((drive = get_info_ptr(inode->i_rdev)) == NULL)
return -ENXIO;
- MOD_INC_USE_COUNT;
if (drive->driver == NULL)
ide_driver_module();
#ifdef CONFIG_KMOD
@@ -1972,14 +1970,10 @@
while (drive->busy)
sleep_on(&drive->wqueue);
drive->usage++;
- if (drive->driver != NULL) {
- if ((rc = DRIVER(drive)->open(inode, filp, drive)))
- MOD_DEC_USE_COUNT;
- return rc;
- }
+ if (drive->driver != NULL)
+ return DRIVER(drive)->open(inode, filp, drive);
printk ("%s: driver not present\n", drive->name);
drive->usage--;
- MOD_DEC_USE_COUNT;
return -ENXIO;
}
@@ -1995,7 +1989,6 @@
drive->usage--;
if (drive->driver != NULL)
DRIVER(drive)->release(inode, file, drive);
- MOD_DEC_USE_COUNT;
}
return 0;
}
@@ -3643,6 +3636,7 @@
}
struct block_device_operations ide_fops[] = {{
+ owner: THIS_MODULE,
open: ide_open,
release: ide_release,
ioctl: ide_ioctl,
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)