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.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
This commit is contained in:
Arunmani Alagarsamy 2025-06-02 17:16:17 +05:30 committed by Benjamin Cabé
commit de6395d5d0

View file

@ -282,11 +282,13 @@ static int siwx91x_apply_power_save(struct siwx91x_dev *sidev)
interface = sl_wifi_get_default_interface();
if (FIELD_GET(SIWX91X_INTERFACE_MASK, interface) != SL_WIFI_CLIENT_INTERFACE) {
return 0;
LOG_ERR("Wi-Fi not in station mode");
return -EINVAL;
}
if (sidev->state == WIFI_STATE_INTERFACE_DISABLED) {
return 0;
LOG_ERR("Command given in invalid state");
return -EINVAL;
}
sl_wifi_get_performance_profile(&sl_ps_profile);