diff mbox series

[1/5] soc: apple: rtkit: Get rid of apple_rtkit_send_message_wait

Message ID 20230328-soc-mailbox-v1-1-3953814532fd@marcan.st (mailing list archive)
State New, archived
Headers show
Series mailbox: apple: Move driver into soc/apple and stop using the subsystem | expand

Commit Message

Hector Martin March 28, 2023, 1:14 p.m. UTC
It is fundamentally broken and has no users. Just remove it.

Signed-off-by: Hector Martin <marcan@marcan.st>
---
 drivers/soc/apple/rtkit.c       | 32 --------------------------------
 include/linux/soc/apple/rtkit.h | 18 ------------------
 2 files changed, 50 deletions(-)

Comments

Eric Curtin March 28, 2023, 1:36 p.m. UTC | #1
On Tue, 28 Mar 2023 at 14:20, Hector Martin <marcan@marcan.st> wrote:
>
> It is fundamentally broken and has no users. Just remove it.
>
> Signed-off-by: Hector Martin <marcan@marcan.st>

Watched the stream

Acked-by: Eric Curtin <ecurtin@redhat.com>

Is mise le meas/Regards,

Eric Curtin

> ---
>  drivers/soc/apple/rtkit.c       | 32 --------------------------------
>  include/linux/soc/apple/rtkit.h | 18 ------------------
>  2 files changed, 50 deletions(-)
>
> diff --git a/drivers/soc/apple/rtkit.c b/drivers/soc/apple/rtkit.c
> index d9f19dc99da5..7c9b9f25bbc1 100644
> --- a/drivers/soc/apple/rtkit.c
> +++ b/drivers/soc/apple/rtkit.c
> @@ -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);
> diff --git a/include/linux/soc/apple/rtkit.h b/include/linux/soc/apple/rtkit.h
> index fc456f75c131..8c9ca857ccf6 100644
> --- a/include/linux/soc/apple/rtkit.h
> +++ b/include/linux/soc/apple/rtkit.h
> @@ -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
>
> --
> 2.40.0
>
>
diff mbox series

Patch

diff --git a/drivers/soc/apple/rtkit.c b/drivers/soc/apple/rtkit.c
index d9f19dc99da5..7c9b9f25bbc1 100644
--- a/drivers/soc/apple/rtkit.c
+++ b/drivers/soc/apple/rtkit.c
@@ -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);
diff --git a/include/linux/soc/apple/rtkit.h b/include/linux/soc/apple/rtkit.h
index fc456f75c131..8c9ca857ccf6 100644
--- a/include/linux/soc/apple/rtkit.h
+++ b/include/linux/soc/apple/rtkit.h
@@ -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