Skip to content

Commit 4cecd8e

Browse files
Arunmani AlagarsamyChromeos LUCI
authored andcommitted
drivers: wifi: siwx91x: Handle error case in power save mode
Power save is not supported in AP mode. This commit ensures that `-EINVAL` is returned instead of success, preventing incorrect behavior. (cherry picked from commit de6395d) Original-Signed-off-by: Arunmani Alagarsamy <[email protected]> GitOrigin-RevId: de6395d Cr-Build-Id: 8712973260362085153 Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8712973260362085153 Copybot-Job-Name: zephyr-main-copybot-downstream Change-Id: I83507875464e9490e24aca56b7b641f64d1bc6e6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/6621872 Tested-by: ChromeOS Copybot <[email protected]> Tested-by: Dawid Niedźwiecki <[email protected]> Reviewed-by: Dawid Niedźwiecki <[email protected]> Commit-Queue: Dawid Niedźwiecki <[email protected]>
1 parent 9e0bbb6 commit 4cecd8e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/wifi/siwx91x/siwx91x_wifi.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,13 @@ static int siwx91x_apply_power_save(struct siwx91x_dev *sidev)
282282

283283
interface = sl_wifi_get_default_interface();
284284
if (FIELD_GET(SIWX91X_INTERFACE_MASK, interface) != SL_WIFI_CLIENT_INTERFACE) {
285-
return 0;
285+
LOG_ERR("Wi-Fi not in station mode");
286+
return -EINVAL;
286287
}
287288

288289
if (sidev->state == WIFI_STATE_INTERFACE_DISABLED) {
289-
return 0;
290+
LOG_ERR("Command given in invalid state");
291+
return -EINVAL;
290292
}
291293

292294
sl_wifi_get_performance_profile(&sl_ps_profile);

0 commit comments

Comments
 (0)