int err;
c->vfs_sb = sb;
+#ifndef __UBOOT__
/* Re-open the UBI device in read-write mode */
c->ubi = ubi_open_volume(c->vi.ubi_num, c->vi.vol_id, UBI_READWRITE);
+#else
+ /* U-Boot read only mode */
+ c->ubi = ubi_open_volume(c->vi.ubi_num, c->vi.vol_id, UBI_READONLY);
+#endif
+
if (IS_ERR(c->ubi)) {
err = PTR_ERR(c->ubi);
goto out;