soc: apple: rtkit: Get rid of apple_rtkit_send_message_wait
authorHector Martin <marcan@marcan.st>
Wed, 4 May 2022 16:25:16 +0000 (01:25 +0900)
committerHector Martin <marcan@marcan.st>
Thu, 23 Nov 2023 10:09:24 +0000 (19:09 +0900)
It is fundamentally broken and has no users. Just remove it.

Acked-by: Eric Curtin <ecurtin@redhat.com>
Acked-by: Neal Gompa <neal@gompa.dev>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Hector Martin <marcan@marcan.st>
drivers/soc/apple/rtkit.c
include/linux/soc/apple/rtkit.h

index d9f19dc99da5e824b327c1a334e5d44e8f7c392b..7c9b9f25bbc198857aa7382d9f2e1ac9ae16b480 100644 (file)
@@ -641,38 +641,6 @@ 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)
-{
-       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;
-       }
-}
-EXPORT_SYMBOL_GPL(apple_rtkit_send_message_wait);
-
 int apple_rtkit_poll(struct apple_rtkit *rtk)
 {
        return mbox_client_peek_data(rtk->mbox_chan);
index fc456f75c13192a82307b31d2926b789a33a6c2a..8c9ca857ccf6a3886cdc8fa897412c2f633da52f 100644 (file)
@@ -160,24 +160,6 @@ int apple_rtkit_start_ep(struct apple_rtkit *rtk, u8 endpoint);
 int apple_rtkit_send_message(struct apple_rtkit *rtk, u8 ep, u64 message,
                             struct completion *completion, bool atomic);
 
-/*
- * Send a message to the given endpoint and wait until it has been submitted
- * to the hardware FIFO.
- * Will return zero on success and a negative error code on failure
- * (e.g. -ETIME when the message couldn't be written within the given
- * timeout)
- *
- * @rtk:            RTKit reference
- * @ep:             target endpoint
- * @message:        message to be sent
- * @timeout:        timeout in milliseconds to allow the message transmission
- *                  to be completed
- * @atomic:         if set to true this function can be called from atomic
- *                  context.
- */
-int apple_rtkit_send_message_wait(struct apple_rtkit *rtk, u8 ep, u64 message,
-                                 unsigned long timeout, bool atomic);
-
 /*
  * Process incoming messages in atomic context.
  * This only guarantees that messages arrive as far as the recv_message_early