]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/usb/gadget/storage_common.c
Merge remote-tracking branch 'usb-gadget/next'
[karo-tx-linux.git] / drivers / usb / gadget / storage_common.c
index ec20a1f50c2d702e56f6e6a79f03485607a36189..20f6ec22fac322266cd9d8bef80ec6e3f7e3b54d 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 (!file_readable(filp)) {
                LINFO(curlun, "file not readable: %s\n", filename);
                goto out;
        }
-       if (!(filp->f_op->write || filp->f_op->aio_write))
+       if (!file_writable(filp))
                ro = 1;
 
        size = i_size_read(inode->i_mapping->host);