mtd: nand: refactor scanning code

A few pieces of code are unnecessarily duplicated. For easier
maintenance, we should fix this.

This should have no functional effect.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
1 file changed