[U-Boot] [PATCH 05/10] dm: serial: Put common code into separate functions