[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1302017802-16614-3-git-send-email-roger.quadros@nokia.com>
Date: Tue, 5 Apr 2011 18:36:39 +0300
From: Roger Quadros <roger.quadros@...ia.com>
To: gregkh@...e.de
Cc: mina86@...a86.com, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 2/5] usb: gadget: f_mass_storage: If 'ro'/'cdrom' specified, open file as read-only
If we don't need Write access then attempt to open backing file in Read Only
mode instead of bailing out too soon.
Signed-off-by: Roger Quadros <roger.quadros@...ia.com>
---
drivers/usb/gadget/f_mass_storage.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index 90472af..5d7de93 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -2810,6 +2810,7 @@ static struct fsg_common *fsg_common_init(struct fsg_common *common,
for (i = 0, lcfg = cfg->luns; i < nluns; ++i, ++curlun, ++lcfg) {
curlun->cdrom = !!lcfg->cdrom;
curlun->ro = lcfg->cdrom || lcfg->ro;
+ curlun->initially_ro = curlun->ro;
curlun->removable = lcfg->removable;
curlun->dev.release = fsg_lun_release;
curlun->dev.parent = &gadget->dev;
--
1.6.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists