]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/usb/gadget/storage_common.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[karo-tx-linux.git] / drivers / usb / gadget / storage_common.c
index ff205a7bc55c9aefcd98994aeb3c25fe4c37eb28..648f9e489b39bb3a291f091771dcd099013176db 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);