diff options
author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2013-10-15 08:33:13 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-10-15 06:52:08 -0500 |
commit | b8798636798ee04feb0f1bb87eec0027e3f68d98 (patch) | |
tree | e1fd22c9a2743d1d383d9ffc7dfcb7871b94c722 /drivers/usb/gadget/f_mass_storage.c | |
parent | 81a1d5ea6670acecf1366cd6a4d328c123bdf9fa (diff) | |
download | op-kernel-dev-b8798636798ee04feb0f1bb87eec0027e3f68d98.zip op-kernel-dev-b8798636798ee04feb0f1bb87eec0027e3f68d98.tar.gz |
usb: gadget: storage_common: pass filesem to fsg_store_cdrom
If cdrom flag is set ro flag is implied. Try setting the ro first, and
only if it succeeds set the cdrom flag.
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/f_mass_storage.c')
-rw-r--r-- | drivers/usb/gadget/f_mass_storage.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c index 6e5a6da..6b5f451 100644 --- a/drivers/usb/gadget/f_mass_storage.c +++ b/drivers/usb/gadget/f_mass_storage.c @@ -3281,7 +3281,12 @@ static ssize_t fsg_lun_opts_cdrom_show(struct fsg_lun_opts *opts, char *page) static ssize_t fsg_lun_opts_cdrom_store(struct fsg_lun_opts *opts, const char *page, size_t len) { - return fsg_store_cdrom(opts->lun, page, len); + struct fsg_opts *fsg_opts; + + fsg_opts = to_fsg_opts(opts->group.cg_item.ci_parent); + + return fsg_store_cdrom(opts->lun, &fsg_opts->common->filesem, page, + len); } static struct fsg_lun_opts_attribute fsg_lun_opts_cdrom = |