mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-24 22:55:35 +08:00
iwlagn: make iwlagn_wait_notification return error code
We're unlikely to care about the actual time spent waiting, so make the function return an error code which is less error prone in coding new uses. Also, while at it, mark __must_check. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
This commit is contained in:
parent
09f18afe76
commit
a8674a1efc
@ -2272,9 +2272,9 @@ void iwlagn_init_notification_wait(struct iwl_priv *priv,
|
|||||||
spin_unlock_bh(&priv->_agn.notif_wait_lock);
|
spin_unlock_bh(&priv->_agn.notif_wait_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
signed long iwlagn_wait_notification(struct iwl_priv *priv,
|
int iwlagn_wait_notification(struct iwl_priv *priv,
|
||||||
struct iwl_notification_wait *wait_entry,
|
struct iwl_notification_wait *wait_entry,
|
||||||
unsigned long timeout)
|
unsigned long timeout)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -2286,7 +2286,10 @@ signed long iwlagn_wait_notification(struct iwl_priv *priv,
|
|||||||
list_del(&wait_entry->list);
|
list_del(&wait_entry->list);
|
||||||
spin_unlock_bh(&priv->_agn.notif_wait_lock);
|
spin_unlock_bh(&priv->_agn.notif_wait_lock);
|
||||||
|
|
||||||
return ret;
|
/* return value is always >= 0 */
|
||||||
|
if (ret <= 0)
|
||||||
|
return -ETIMEDOUT;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void iwlagn_remove_notification(struct iwl_priv *priv,
|
void iwlagn_remove_notification(struct iwl_priv *priv,
|
||||||
|
@ -73,13 +73,9 @@ static int iwlagn_disable_pan(struct iwl_priv *priv,
|
|||||||
IWL_ERR(priv, "Error disabling PAN (%d)\n", ret);
|
IWL_ERR(priv, "Error disabling PAN (%d)\n", ret);
|
||||||
iwlagn_remove_notification(priv, &disable_wait);
|
iwlagn_remove_notification(priv, &disable_wait);
|
||||||
} else {
|
} else {
|
||||||
signed long wait_res;
|
ret = iwlagn_wait_notification(priv, &disable_wait, HZ);
|
||||||
|
if (ret)
|
||||||
wait_res = iwlagn_wait_notification(priv, &disable_wait, HZ);
|
|
||||||
if (wait_res == 0) {
|
|
||||||
IWL_ERR(priv, "Timed out waiting for PAN disable\n");
|
IWL_ERR(priv, "Timed out waiting for PAN disable\n");
|
||||||
ret = -EIO;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -343,7 +343,7 @@ iwlagn_init_notification_wait(struct iwl_priv *priv,
|
|||||||
struct iwl_rx_packet *pkt,
|
struct iwl_rx_packet *pkt,
|
||||||
void *data),
|
void *data),
|
||||||
void *fn_data);
|
void *fn_data);
|
||||||
signed long __releases(wait_entry)
|
int __must_check __releases(wait_entry)
|
||||||
iwlagn_wait_notification(struct iwl_priv *priv,
|
iwlagn_wait_notification(struct iwl_priv *priv,
|
||||||
struct iwl_notification_wait *wait_entry,
|
struct iwl_notification_wait *wait_entry,
|
||||||
unsigned long timeout);
|
unsigned long timeout);
|
||||||
|
Loading…
Reference in New Issue
Block a user