mtd: merge MTD development from v4.4 into for-v4.5 development

Small conflict between some bugfixes for 4.4 and some refactoring for
4.5.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>