cros_ec: Fail if we cannot determine the flash burst size
This value is required for flashing to work correctly. Add a check for
it.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/drivers/misc/cros_ec.c b/drivers/misc/cros_ec.c
index e0f3dfc..7daf164 100644
--- a/drivers/misc/cros_ec.c
+++ b/drivers/misc/cros_ec.c
@@ -827,6 +827,9 @@
uint32_t end, off;
int ret;
+ if (!burst)
+ return -EINVAL;
+
/*
* TODO: round up to the nearest multiple of write size. Can get away
* without that on link right now because its write size is 4 bytes.