Skip to content

Commit 0625d3f

Browse files
committed
soc: apple: rtkit: Add devm_apple_rtkit_free()
To be used to free a RTKit interface while the associated device remains alive. Probably useless since it's unknown how or if RTKit based co-processors can be restarted. Signed-off-by: Janne Grunau <j@jannau.net>
1 parent 02e0f2e commit 0625d3f

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

drivers/soc/apple/rtkit.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,12 @@ struct apple_rtkit *devm_apple_rtkit_init(struct device *dev, void *cookie,
958958
}
959959
EXPORT_SYMBOL_GPL(devm_apple_rtkit_init);
960960

961+
void devm_apple_rtkit_free(struct device *dev, struct apple_rtkit *rtk)
962+
{
963+
devm_release_action(dev, apple_rtkit_free_wrapper, rtk);
964+
}
965+
EXPORT_SYMBOL_GPL(devm_apple_rtkit_free);
966+
961967
MODULE_LICENSE("Dual MIT/GPL");
962968
MODULE_AUTHOR("Sven Peter <sven@svenpeter.dev>");
963969
MODULE_DESCRIPTION("Apple RTKit driver");

include/linux/soc/apple/rtkit.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ struct apple_rtkit;
7878
struct apple_rtkit *devm_apple_rtkit_init(struct device *dev, void *cookie,
7979
const char *mbox_name, int mbox_idx,
8080
const struct apple_rtkit_ops *ops);
81+
/*
82+
* Frees internal RTKit state allocated by devm_apple_rtkit_init().
83+
*
84+
* @dev: Pointer to the device node this coprocessor is assocated with
85+
* @rtk: Internal RTKit state initialized by devm_apple_rtkit_init()
86+
*/
87+
void devm_apple_rtkit_free(struct device *dev, struct apple_rtkit *rtk);
8188

8289
/*
8390
* Non-devm version of devm_apple_rtkit_init. Must be freed with

0 commit comments

Comments
 (0)