Skip to content
  • Brian Norris's avatar
    platform/chrome: straighten out cros_ec_get_{next,host}_event() error codes · 475b0873
    Brian Norris authored
    
    
    cros_ec_get_next_event() is documented to return 0 for success and
    negative for errors. It currently returns negative for some errors, and
    non-negative (number of bytes received) for success (including some "no
    data available" responses as zero). This mostly works out OK, because the
    callers were more or less ignoring the documentation, and only treating
    positive values as success (and indepdently checking the modification of
    'wakeup').
    
    Let's button this up by avoiding pretending to handle event/wakeup
    distinctions when no event info was retrieved (i.e., returned 0 bytes).
    And fix the documentation of cros_ec_get_host_event() and
    cros_ec_get_next_event() to accurately describe their behavior.
    
    Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
    Acked-by: default avatarLee Jones <lee.jones@linaro.org>
    Signed-off-by: default avatarBenson Leung <bleung@chromium.org>
    475b0873