android_mtdutils: Add mtd_write_descriptor

This CL adds "mtd_write_descriptor" to create a write context from a
file descriptor. It also refactors the code, especially
mtd_write_partition and write_block to alleviate the need of an
MtdPartition.

BUG=chromium:426742
TEST=emerge android_mtdutils

Change-Id: I450f21ab6ae3dd774cb531f9b166dd1864b83d05
Reviewed-on: https://chromium-review.googlesource.com/234457
Reviewed-by: Mike Frysinger <[email protected]>
Commit-Queue: Nam Nguyen <[email protected]>
Trybot-Ready: Nam Nguyen <[email protected]>
Tested-by: Nam Nguyen <[email protected]>
2 files changed