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).


Change-Id: I4b8c5775fb8f4b0dff702fcc0fb258221254c659
Signed-off-by: Anastasia Klimchuk <>
Tested-by: build bot (Jenkins) <>
Reviewed-by: Edward O'Callaghan <>
1 file changed