ene_lpc.c: Extract params check into a function

This allows char *p to become a local variable in check_params,
and it is allocated and freed within check_params function.
Which means init function does not need char *p anymore,
in particular does not need to free it - and this makes cleanup
after failed init easier.

As a good side effect, init function becomes easier to read.


Change-Id: I7c3b6dea0edbc7547f0b307a0508c7d2b2a6d370
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/52684
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
1 file changed