The same code is used in several place / files. Make a macro out of it. Signed-off-by: Carlo Caione <ccaione@baylibre.com>