Martin L Roth has submitted this change. ( https://review.coreboot.org/c/coreboot/+/69369 )
(
1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: ec/google/chromeec: Simplify KEYBOARD_BACKLIGHT error handling ......................................................................
ec/google/chromeec: Simplify KEYBOARD_BACKLIGHT error handling
Simplify the implementation of setting the keyboard backlight PWM value. Host command stubs typcially don't need to examine the host command's return value as stored in cmd_code because that level of detail is not very interesting. Higher value error codes are returned in actual result structures.
This host command can return EC_RES_ERROR for out of range PWM values which is already a generic error and unlikely to happen since we already limit the range to 0..100 here. Finally, none of the callers in coreboot check the return value.
BUG=b:258126464 BRANCH=none TEST=none
Change-Id: If17bc4e31baba02ba2f7ae8e7a5cbec7f97688c5 Signed-off-by: Caveh Jalali caveh@chromium.org Reviewed-on: https://review.coreboot.org/c/coreboot/+/69369 Reviewed-by: Daisuke Nojiri dnojiri@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/ec/google/chromeec/ec.c 1 file changed, 32 insertions(+), 4 deletions(-)
Approvals: build bot (Jenkins): Verified Daisuke Nojiri: Looks good to me, approved
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c index b609559..3afe840 100644 --- a/src/ec/google/chromeec/ec.c +++ b/src/ec/google/chromeec/ec.c @@ -87,10 +87,10 @@ .cmd_dev_index = 0, };
- google_chromeec_command(&cmd); - printk(BIOS_DEBUG, "Google Chrome set keyboard backlight: status (%x)\n", - cmd.cmd_code); - return cmd.cmd_code; + if (google_chromeec_command(&cmd) != 0) + return -1; + + return 0; }
void google_chromeec_post(uint8_t postcode)