struct rw_semaphore *filesem = dev_get_drvdata(dev);
int rc = 0;
+#ifndef CONFIG_USB_G_ANDROID
if (curlun->prevent_medium_removal && fsg_lun_is_open(curlun)) {
LDBG(curlun, "eject attempt prevented\n");
return -EBUSY; /* "Door is locked" */
}
+#endif
/* Remove a trailing newline */
if (count > 0 && buf[count-1] == '\n')
/* Load new medium */
down_write(filesem);
if (count > 0 && buf[0]) {
+ LDBG(curlun, "fsg_lun_open\n");
/* fsg_lun_open() will close existing file if any. */
rc = fsg_lun_open(curlun, buf);
if (rc == 0)
curlun->unit_attention_data =
SS_NOT_READY_TO_READY_TRANSITION;
} else if (fsg_lun_is_open(curlun)) {
+ LDBG(curlun, "fsg_lun_open\n");
fsg_lun_close(curlun);
curlun->unit_attention_data = SS_MEDIUM_NOT_PRESENT;
}