[PATCH 1/6] efi: Refactor device and image paths into a function