mtd: remove R/O checking duplication