rtkit.c (29583dfcd2dd72c766422bd05c16f06c6b1fb356) rtkit.c (5acf07ff25f0c1c44105e6b8ebf88c55a0a04d2f)
1// SPDX-License-Identifier: GPL-2.0-only OR MIT
2/*
3 * Apple RTKit IPC library
4 * Copyright (C) The Asahi Linux Contributors
5 */
6
7#include "rtkit-internal.h"
8

--- 912 unchanged lines hidden (view full) ---

921 msg = FIELD_PREP(APPLE_RTKIT_MGMT_PWR_STATE, APPLE_RTKIT_PWR_STATE_ON);
922 apple_rtkit_management_send(rtk, APPLE_RTKIT_MGMT_SET_IOP_PWR_STATE,
923 msg);
924
925 return apple_rtkit_boot(rtk);
926}
927EXPORT_SYMBOL_GPL(apple_rtkit_wake);
928
1// SPDX-License-Identifier: GPL-2.0-only OR MIT
2/*
3 * Apple RTKit IPC library
4 * Copyright (C) The Asahi Linux Contributors
5 */
6
7#include "rtkit-internal.h"
8

--- 912 unchanged lines hidden (view full) ---

921 msg = FIELD_PREP(APPLE_RTKIT_MGMT_PWR_STATE, APPLE_RTKIT_PWR_STATE_ON);
922 apple_rtkit_management_send(rtk, APPLE_RTKIT_MGMT_SET_IOP_PWR_STATE,
923 msg);
924
925 return apple_rtkit_boot(rtk);
926}
927EXPORT_SYMBOL_GPL(apple_rtkit_wake);
928
929static void apple_rtkit_free(struct apple_rtkit *rtk)
929static void apple_rtkit_free(void *data)
930{
930{
931 struct apple_rtkit *rtk = data;
932
931 mbox_free_channel(rtk->mbox_chan);
932 destroy_workqueue(rtk->wq);
933
934 apple_rtkit_free_buffer(rtk, &rtk->ioreport_buffer);
935 apple_rtkit_free_buffer(rtk, &rtk->crashlog_buffer);
936 apple_rtkit_free_buffer(rtk, &rtk->syslog_buffer);
937
938 kfree(rtk->syslog_msg_buffer);

--- 6 unchanged lines hidden (view full) ---

945{
946 struct apple_rtkit *rtk;
947 int ret;
948
949 rtk = apple_rtkit_init(dev, cookie, mbox_name, mbox_idx, ops);
950 if (IS_ERR(rtk))
951 return rtk;
952
933 mbox_free_channel(rtk->mbox_chan);
934 destroy_workqueue(rtk->wq);
935
936 apple_rtkit_free_buffer(rtk, &rtk->ioreport_buffer);
937 apple_rtkit_free_buffer(rtk, &rtk->crashlog_buffer);
938 apple_rtkit_free_buffer(rtk, &rtk->syslog_buffer);
939
940 kfree(rtk->syslog_msg_buffer);

--- 6 unchanged lines hidden (view full) ---

947{
948 struct apple_rtkit *rtk;
949 int ret;
950
951 rtk = apple_rtkit_init(dev, cookie, mbox_name, mbox_idx, ops);
952 if (IS_ERR(rtk))
953 return rtk;
954
953 ret = devm_add_action_or_reset(dev, (void (*)(void *))apple_rtkit_free,
954 rtk);
955 ret = devm_add_action_or_reset(dev, apple_rtkit_free, rtk);
955 if (ret)
956 return ERR_PTR(ret);
957
958 return rtk;
959}
960EXPORT_SYMBOL_GPL(devm_apple_rtkit_init);
961
962MODULE_LICENSE("Dual MIT/GPL");
963MODULE_AUTHOR("Sven Peter <sven@svenpeter.dev>");
964MODULE_DESCRIPTION("Apple RTKit driver");
956 if (ret)
957 return ERR_PTR(ret);
958
959 return rtk;
960}
961EXPORT_SYMBOL_GPL(devm_apple_rtkit_init);
962
963MODULE_LICENSE("Dual MIT/GPL");
964MODULE_AUTHOR("Sven Peter <sven@svenpeter.dev>");
965MODULE_DESCRIPTION("Apple RTKit driver");