linux_spi.c: Extract get_max_kernel_buf_size() as a function

To get max_kernel_buf_size is a piece of logic on its own, it opens
resources and closes resources, also has some local variables only
for this task. Extracting get_max_kernel_buf_size() as a separate
function simplifies init flow and allows to remove global state from linux_spi
(see next patches in this chain).

TEST=builds
BUG=b:140394053

Change-Id: I4b8c5775fb8f4b0dff702fcc0fb258221254c659
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/52283
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
1 file changed