mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 21:22:37 +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:
parent
7ecdee6eaa
commit
e6b4354530
10
src/wiphy.c
10
src/wiphy.c
@ -2013,14 +2013,14 @@ void wiphy_radio_work_done(struct wiphy *wiphy, uint32_t id)
|
|||||||
wiphy_radio_work_next(wiphy);
|
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)
|
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)
|
static int wiphy_init(void)
|
||||||
|
@ -130,4 +130,4 @@ uint32_t wiphy_radio_work_insert(struct wiphy *wiphy,
|
|||||||
int priority,
|
int priority,
|
||||||
const struct wiphy_radio_work_item_ops *ops);
|
const struct wiphy_radio_work_item_ops *ops);
|
||||||
void wiphy_radio_work_done(struct wiphy *wiphy, uint32_t id);
|
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user