Skip to content

Commit 9821d75

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 0ff41df commit 9821d75

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
@@ -959,6 +959,12 @@ struct apple_rtkit *devm_apple_rtkit_init(struct device *dev, void *cookie,
959959
}
960960
EXPORT_SYMBOL_GPL(devm_apple_rtkit_init);
961961

962+
void devm_apple_rtkit_free(struct device *dev, struct apple_rtkit *rtk)
963+
{
964+
devm_release_action(dev, apple_rtkit_free_wrapper, rtk);
965+
}
966+
EXPORT_SYMBOL_GPL(devm_apple_rtkit_free);
967+
962968
MODULE_LICENSE("Dual MIT/GPL");
963969
MODULE_AUTHOR("Sven Peter <sven@svenpeter.dev>");
964970
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)