Skip to content

Commit 6431481

Browse files
jannaumarcan
authored andcommitted
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 <[email protected]>
1 parent db1cc8a commit 6431481

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
@@ -989,6 +989,12 @@ struct apple_rtkit *devm_apple_rtkit_init(struct device *dev, void *cookie,
989989
}
990990
EXPORT_SYMBOL_GPL(devm_apple_rtkit_init);
991991

992+
void devm_apple_rtkit_free(struct device *dev, struct apple_rtkit *rtk)
993+
{
994+
devm_release_action(dev, apple_rtkit_free_wrapper, rtk);
995+
}
996+
EXPORT_SYMBOL_GPL(devm_apple_rtkit_free);
997+
992998
MODULE_LICENSE("Dual MIT/GPL");
993999
MODULE_AUTHOR("Sven Peter <[email protected]>");
9941000
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)