During some BSP development process, I found some tools in mtd-utils contain legacy interfaces and it is not suitable with the current linux kernel. I post my patches here in case somebody else need them.