]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/mtd/nand/nandsim.c
Merge remote-tracking branch 'hid/for-next'
[karo-tx-linux.git] / drivers / mtd / nand / nandsim.c
index bdc1d15369f844bfce700a9794b4f8eb558fa921..414f5225ae8b2ece87f1044e6c2a293ae481a773 100644 (file)
@@ -575,12 +575,12 @@ static int alloc_device(struct nandsim *ns)
                cfile = filp_open(cache_file, O_CREAT | O_RDWR | O_LARGEFILE, 0600);
                if (IS_ERR(cfile))
                        return PTR_ERR(cfile);
-               if (!cfile->f_op || (!cfile->f_op->read && !cfile->f_op->aio_read)) {
+               if (!file_readable(cfile)) {
                        NS_ERR("alloc_device: cache file not readable\n");
                        err = -EINVAL;
                        goto err_close;
                }
-               if (!cfile->f_op->write && !cfile->f_op->aio_write) {
+               if (!file_writable(cfile)) {
                        NS_ERR("alloc_device: cache file not writeable\n");
                        err = -EINVAL;
                        goto err_close;