* is not reset.
*/
+#define LOG_CATEGORY UCLASS_CROS_EC
+
#include <common.h>
#include <command.h>
#include <dm.h>
int cros_ec_read_id(struct udevice *dev, char *id, int maxlen)
{
struct ec_response_get_version *r;
+ int ret;
- if (ec_command_inptr(dev, EC_CMD_GET_VERSION, 0, NULL, 0,
- (uint8_t **)&r, sizeof(*r)) != sizeof(*r))
+ ret = ec_command_inptr(dev, EC_CMD_GET_VERSION, 0, NULL, 0,
+ (uint8_t **)&r, sizeof(*r));
+ if (ret != sizeof(*r)) {
+ log_err("Got rc %d, expected %d\n", ret, sizeof(*r));
return -1;
+ }
if (maxlen > (int)sizeof(r->version_string_ro))
maxlen = sizeof(r->version_string_ro);
memcpy(id, r->version_string_rw, maxlen);
break;
default:
+ log_err("Invalid EC image %d\n", r->current_image);
return -1;
}