fix mtd dev mode open
@@ -442,11 +442,9 @@ class otsu_updater(object):
status, msg = 1, FAILURE
with ctrls[0] as ctrl:
- rd_modify = flash.get('read-modify-write', False)
- open_mode = 'wa+' if rd_modify else 'w+b'
- with mtd(ctrl.devpath).open(open_mode) as mtd_dev:
+ with mtd(ctrl.devpath).open('r+b') as mtd_dev:
try:
- if rd_modify:
+ if flash.get('read-modify-write', False):
status, msg = self.read_modify_write(flash, mtd_dev)
else:
self.erase(flash, mtd_dev)
