[U-Boot] [PATCH 3/7] dm: serial: consolidate common code