eeprom: Add error checking to common codepaths

This is a follow-up to 0d65a1a which changed the return type from
size_t to int. This patch adds error checking where it was previously
assumed that eeprom->device->size() could not fail.

BUG=none
BRANCH=none
TEST="mosys eeprom" commands still work on cyan

Change-Id: Ib10423e03f0058531b218c895877bcac9adcf2ed
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/320794
Reviewed-by: Shawn N <shawnn@chromium.org>
2 files changed