[PATCH 03/16] ubi: do not use filep

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 drivers/mtd/ubi/cdev.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c
index 5520132..46e1cb5 100644
--- a/drivers/mtd/ubi/cdev.c
+++ b/drivers/mtd/ubi/cdev.c
@@ -9,7 +9,6 @@ struct ubi_volume_cdev_priv {
 	struct ubi_device *ubi;
 	struct ubi_volume *vol;
 	int updating;
-	unsigned long mode;
 };
 
 static ssize_t ubi_volume_cdev_read(struct cdev *cdev, void *buf, size_t size,
@@ -86,12 +85,7 @@ static int ubi_volume_cdev_open(struct cdev *cdev, struct filep *f)
 {
 	struct ubi_volume_cdev_priv *priv = cdev->priv;
 
-	/* only allow read or write, but not both */
-	if ((f->flags & O_ACCMODE) == O_RDWR)
-		return -EINVAL;
-
 	priv->updating = 0;
-	priv->mode = f->flags & O_ACCMODE;
 
 	return 0;
 }
@@ -132,7 +126,7 @@ static off_t ubi_volume_cdev_lseek(struct cdev *cdev, off_t ofs)
 	struct ubi_volume_cdev_priv *priv = cdev->priv;
 
 	/* We can only update ubi volumes sequentially */
-	if (priv->mode == O_WRONLY)
+	if (priv->updating)
 		return -EINVAL;
 
 	return ofs;
-- 
1.7.2.3


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox


[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux