forked from Minki/linux
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@nokia.com> Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
73ee4da994
commit
3c624d4962
@ -2757,6 +2757,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;
|
||||
|
Loading…
Reference in New Issue
Block a user