diff mbox series

[U-Boot,03/25] cros_ec: Fail if we cannot determine the flash burst size

Message ID 20181106222142.94537-4-sjg@chromium.org
State Accepted
Commit dc05ac0f2f3a5b2f301e2790afe45cb11cf0258f
Delegated to: Simon Glass
Headers show
Series sandbox: Changes and improvements to support verified boot | expand

Commit Message

Simon Glass Nov. 6, 2018, 10:21 p.m. UTC
This value is required for flashing to work correctly. Add a check for
it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 drivers/misc/cros_ec.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Simon Glass Nov. 22, 2018, 8:20 p.m. UTC | #1
This value is required for flashing to work correctly. Add a check for
it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 drivers/misc/cros_ec.c | 3 +++
 1 file changed, 3 insertions(+)

Applied to u-boot-dm/master, thanks!
diff mbox series

Patch

diff --git a/drivers/misc/cros_ec.c b/drivers/misc/cros_ec.c
index e0f3dfc98e0..7daf16499aa 100644
--- a/drivers/misc/cros_ec.c
+++ b/drivers/misc/cros_ec.c
@@ -827,6 +827,9 @@  int cros_ec_flash_write(struct udevice *dev, const uint8_t *data,
 	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.