diff options
Diffstat (limited to 'drivers/soc/apple/rtkit.c')
-rw-r--r-- | drivers/soc/apple/rtkit.c | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/drivers/soc/apple/rtkit.c b/drivers/soc/apple/rtkit.c index cf1129e9f76b..0a449e95c22b 100644 --- a/drivers/soc/apple/rtkit.c +++ b/drivers/soc/apple/rtkit.c @@ -628,37 +628,11 @@ int apple_rtkit_send_message(struct apple_rtkit *rtk, u8 ep, u64 message, } EXPORT_SYMBOL_GPL(apple_rtkit_send_message); -int apple_rtkit_send_message_wait(struct apple_rtkit *rtk, u8 ep, u64 message, - unsigned long timeout, bool atomic) +int apple_rtkit_poll(struct apple_rtkit *rtk) { - DECLARE_COMPLETION_ONSTACK(completion); - int ret; - long t; - - ret = apple_rtkit_send_message(rtk, ep, message, &completion, atomic); - if (ret < 0) - return ret; - - if (atomic) { - ret = mbox_flush(rtk->mbox_chan, timeout); - if (ret < 0) - return ret; - - if (try_wait_for_completion(&completion)) - return 0; - - return -ETIME; - } else { - t = wait_for_completion_interruptible_timeout( - &completion, msecs_to_jiffies(timeout)); - if (t < 0) - return t; - else if (t == 0) - return -ETIME; - return 0; - } + return mbox_client_peek_data(rtk->mbox_chan); } -EXPORT_SYMBOL_GPL(apple_rtkit_send_message_wait); +EXPORT_SYMBOL_GPL(apple_rtkit_poll); int apple_rtkit_start_ep(struct apple_rtkit *rtk, u8 endpoint) { |