[PATCH] soc: apple: rtkit: Export non-devm init/free functions

Hector Martin marcan at marcan.st
Tue Jan 31 03:44:23 PST 2023


On 21/01/2023 16.41, Asahi Lina wrote:
> While we normally encourage devm usage by drivers, some consumers (and
> in particular the upcoming Rust abstractions) might want to manually
> manage memory. Export the raw functions to make this possible.
> 
> Signed-off-by: Asahi Lina <lina at asahilina.net>
> ---
>  drivers/soc/apple/rtkit.c       | 15 ++++++++++-----
>  include/linux/soc/apple/rtkit.h | 19 +++++++++++++++++++
>  2 files changed, 29 insertions(+), 5 deletions(-)
> 

Thanks, applied to asahi-soc/soc!

> diff --git a/drivers/soc/apple/rtkit.c b/drivers/soc/apple/rtkit.c
> index fa3cda831d2b..bb33f3cd4efd 100644
> --- a/drivers/soc/apple/rtkit.c
> +++ b/drivers/soc/apple/rtkit.c
> @@ -686,7 +686,7 @@ static int apple_rtkit_request_mbox_chan(struct apple_rtkit *rtk)
>  	return mbox_start_channel(rtk->mbox_chan);
>  }
>  
> -static struct apple_rtkit *apple_rtkit_init(struct device *dev, void *cookie,
> +struct apple_rtkit *apple_rtkit_init(struct device *dev, void *cookie,
>  					    const char *mbox_name, int mbox_idx,
>  					    const struct apple_rtkit_ops *ops)
>  {

FYI: This hunk didn't apply cleanly on the upstream tree due to a
context difference in apple_rtkit_request_mbox_chan (I think you based
this on some other change), but it was easy enough to fix.

- Hector



More information about the linux-arm-kernel mailing list