]> git.karo-electronics.de Git - linux-beck.git/blobdiff - drivers/usb/gadget/storage_common.c
replace checking for ->read/->aio_read presence with check in ->f_mode
[linux-beck.git] / drivers / usb / gadget / storage_common.c
index ec20a1f50c2d702e56f6e6a79f03485607a36189..a8898df131ed5b4abdf37adb8784645e88840381 100644 (file)
@@ -220,11 +220,11 @@ int fsg_lun_open(struct fsg_lun *curlun, const char *filename)
         * If we can't read the file, it's no good.
         * If we can't write the file, use it read-only.
         */
-       if (!(filp->f_op->read || filp->f_op->aio_read)) {
+       if (!(filp->f_mode & FMODE_CAN_READ)) {
                LINFO(curlun, "file not readable: %s\n", filename);
                goto out;
        }
-       if (!(filp->f_op->write || filp->f_op->aio_write))
+       if (!(filp->f_mode & FMODE_CAN_WRITE))
                ro = 1;
 
        size = i_size_read(inode->i_mapping->host);