File tree Expand file tree Collapse file tree
drivers/platform/chrome/wilco_ec Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,28 +73,33 @@ static int send_kbbl_msg(struct wilco_ec_device *ec,
7373 return ret ;
7474 }
7575
76- if (response -> status ) {
77- dev_err (ec -> dev ,
78- "EC reported failure sending keyboard LEDs command: %d" ,
79- response -> status );
80- return - EIO ;
81- }
82-
8376 return 0 ;
8477}
8578
8679static int set_kbbl (struct wilco_ec_device * ec , enum led_brightness brightness )
8780{
8881 struct wilco_keyboard_leds_msg request ;
8982 struct wilco_keyboard_leds_msg response ;
83+ int ret ;
9084
9185 memset (& request , 0 , sizeof (request ));
9286 request .command = WILCO_EC_COMMAND_KBBL ;
9387 request .subcmd = WILCO_KBBL_SUBCMD_SET_STATE ;
9488 request .mode = WILCO_KBBL_MODE_FLAG_PWM ;
9589 request .percent = brightness ;
9690
97- return send_kbbl_msg (ec , & request , & response );
91+ ret = send_kbbl_msg (ec , & request , & response );
92+ if (ret < 0 )
93+ return ret ;
94+
95+ if (response .status ) {
96+ dev_err (ec -> dev ,
97+ "EC reported failure sending keyboard LEDs command: %d" ,
98+ response .status );
99+ return - EIO ;
100+ }
101+
102+ return 0 ;
98103}
99104
100105static int kbbl_exist (struct wilco_ec_device * ec , bool * exists )
@@ -140,6 +145,13 @@ static int kbbl_init(struct wilco_ec_device *ec)
140145 if (ret < 0 )
141146 return ret ;
142147
148+ if (response .status ) {
149+ dev_err (ec -> dev ,
150+ "EC reported failure sending keyboard LEDs command: %d" ,
151+ response .status );
152+ return - EIO ;
153+ }
154+
143155 if (response .mode & WILCO_KBBL_MODE_FLAG_PWM )
144156 return response .percent ;
145157
You can’t perform that action at this time.
0 commit comments