3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 13:02:44 +01:00

wiphy: update wiphy_radio_work_is_running to return int

This differentiates between pending, running, and non-existent:
false, true, -ENOENT respectively
This commit is contained in:
James Prestwood 2021-12-06 12:17:25 -08:00 committed by Denis Kenzior
parent 7ecdee6eaa
commit e6b4354530
2 changed files with 6 additions and 6 deletions

View File

@ -2013,14 +2013,14 @@ void wiphy_radio_work_done(struct wiphy *wiphy, uint32_t id)
wiphy_radio_work_next(wiphy);
}
bool wiphy_radio_work_is_running(struct wiphy *wiphy, uint32_t id)
int wiphy_radio_work_is_running(struct wiphy *wiphy, uint32_t id)
{
struct wiphy_radio_work_item *item = l_queue_peek_head(wiphy->work);
struct wiphy_radio_work_item *item = l_queue_find(wiphy->work, match_id,
L_UINT_TO_PTR(id));
if (!item)
return false;
return -ENOENT;
return item->id == id;
return item == l_queue_peek_head(wiphy->work) ? 1 : 0;
}
static int wiphy_init(void)

View File

@ -130,4 +130,4 @@ uint32_t wiphy_radio_work_insert(struct wiphy *wiphy,
int priority,
const struct wiphy_radio_work_item_ops *ops);
void wiphy_radio_work_done(struct wiphy *wiphy, uint32_t id);
bool wiphy_radio_work_is_running(struct wiphy *wiphy, uint32_t id);
int wiphy_radio_work_is_running(struct wiphy *wiphy, uint32_t id);