We might as well use this common function instead of repeating the same code. Signed-off-by: Simon Glass <sjg@chromium.org>