Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83486
b: refs/heads/master
c: 35841f7
h: refs/heads/master
v: v3
  • Loading branch information
Borislav Petkov authored and Linus Torvalds committed Feb 6, 2008
1 parent f61b858 commit f005fc8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 18a2354db7d7e43da08c0351263fd5b5fc20a38d
refs/heads/master: 35841f708070bd295a96f6c98e566f8b251c1b48
17 changes: 9 additions & 8 deletions trunk/drivers/cdrom/cdrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -1206,25 +1206,26 @@ int check_for_audio_disc(struct cdrom_device_info * cdi,
return 0;
}

/* Admittedly, the logic below could be performed in a nicer way. */
int cdrom_release(struct cdrom_device_info *cdi, struct file *fp)
{
struct cdrom_device_ops *cdo = cdi->ops;
int opened_for_data;

cdinfo(CD_CLOSE, "entering cdrom_release\n");
cdinfo(CD_CLOSE, "entering cdrom_release\n");

if (cdi->use_count > 0)
cdi->use_count--;
if (cdi->use_count == 0)

if (cdi->use_count == 0) {
cdinfo(CD_CLOSE, "Use count for \"/dev/%s\" now zero\n", cdi->name);
if (cdi->use_count == 0)
cdrom_dvd_rw_close_write(cdi);
if (cdi->use_count == 0 &&
(cdo->capability & CDC_LOCK) && !keeplocked) {
cdinfo(CD_CLOSE, "Unlocking door!\n");
cdo->lock_door(cdi, 0);

if ((cdo->capability & CDC_LOCK) && !keeplocked) {
cdinfo(CD_CLOSE, "Unlocking door!\n");
cdo->lock_door(cdi, 0);
}
}

opened_for_data = !(cdi->options & CDO_USE_FFLAGS) ||
!(fp && fp->f_flags & O_NONBLOCK);

Expand Down

0 comments on commit f005fc8

Please sign in to comment.