Lines Matching refs:rtk
76 struct apple_rtkit *rtk; member
82 bool apple_rtkit_is_running(struct apple_rtkit *rtk) in apple_rtkit_is_running() argument
84 if (rtk->crashed) in apple_rtkit_is_running()
86 if ((rtk->iop_power_state & 0xff) != APPLE_RTKIT_PWR_STATE_ON) in apple_rtkit_is_running()
88 if ((rtk->ap_power_state & 0xff) != APPLE_RTKIT_PWR_STATE_ON) in apple_rtkit_is_running()
94 bool apple_rtkit_is_crashed(struct apple_rtkit *rtk) in apple_rtkit_is_crashed() argument
96 return rtk->crashed; in apple_rtkit_is_crashed()
100 static void apple_rtkit_management_send(struct apple_rtkit *rtk, u8 type, in apple_rtkit_management_send() argument
105 apple_rtkit_send_message(rtk, APPLE_RTKIT_EP_MGMT, msg, NULL, false); in apple_rtkit_management_send()
108 static void apple_rtkit_management_rx_hello(struct apple_rtkit *rtk, u64 msg) in apple_rtkit_management_rx_hello() argument
116 dev_dbg(rtk->dev, "RTKit: Min ver %d, max ver %d\n", min_ver, max_ver); in apple_rtkit_management_rx_hello()
119 dev_err(rtk->dev, "RTKit: Firmware min version %d is too new\n", in apple_rtkit_management_rx_hello()
125 dev_err(rtk->dev, "RTKit: Firmware max version %d is too old\n", in apple_rtkit_management_rx_hello()
130 dev_info(rtk->dev, "RTKit: Initializing (protocol version %d)\n", in apple_rtkit_management_rx_hello()
132 rtk->version = want_ver; in apple_rtkit_management_rx_hello()
136 apple_rtkit_management_send(rtk, APPLE_RTKIT_MGMT_HELLO_REPLY, reply); in apple_rtkit_management_rx_hello()
141 rtk->boot_result = -EINVAL; in apple_rtkit_management_rx_hello()
142 complete_all(&rtk->epmap_completion); in apple_rtkit_management_rx_hello()
145 static void apple_rtkit_management_rx_epmap(struct apple_rtkit *rtk, u64 msg) in apple_rtkit_management_rx_epmap() argument
152 dev_dbg(rtk->dev, in apple_rtkit_management_rx_epmap()
158 dev_dbg(rtk->dev, "RTKit: Discovered endpoint 0x%02x\n", ep); in apple_rtkit_management_rx_epmap()
159 set_bit(ep, rtk->endpoints); in apple_rtkit_management_rx_epmap()
168 apple_rtkit_management_send(rtk, APPLE_RTKIT_MGMT_EPMAP_REPLY, reply); in apple_rtkit_management_rx_epmap()
173 for_each_set_bit(ep, rtk->endpoints, APPLE_RTKIT_APP_ENDPOINT_START) { in apple_rtkit_management_rx_epmap()
185 dev_dbg(rtk->dev, in apple_rtkit_management_rx_epmap()
187 apple_rtkit_start_ep(rtk, ep); in apple_rtkit_management_rx_epmap()
191 dev_warn(rtk->dev, in apple_rtkit_management_rx_epmap()
197 rtk->boot_result = 0; in apple_rtkit_management_rx_epmap()
198 complete_all(&rtk->epmap_completion); in apple_rtkit_management_rx_epmap()
201 static void apple_rtkit_management_rx_iop_pwr_ack(struct apple_rtkit *rtk, in apple_rtkit_management_rx_iop_pwr_ack() argument
206 dev_dbg(rtk->dev, "RTKit: IOP power state transition: 0x%x -> 0x%x\n", in apple_rtkit_management_rx_iop_pwr_ack()
207 rtk->iop_power_state, new_state); in apple_rtkit_management_rx_iop_pwr_ack()
208 rtk->iop_power_state = new_state; in apple_rtkit_management_rx_iop_pwr_ack()
210 complete_all(&rtk->iop_pwr_ack_completion); in apple_rtkit_management_rx_iop_pwr_ack()
213 static void apple_rtkit_management_rx_ap_pwr_ack(struct apple_rtkit *rtk, in apple_rtkit_management_rx_ap_pwr_ack() argument
218 dev_dbg(rtk->dev, "RTKit: AP power state transition: 0x%x -> 0x%x\n", in apple_rtkit_management_rx_ap_pwr_ack()
219 rtk->ap_power_state, new_state); in apple_rtkit_management_rx_ap_pwr_ack()
220 rtk->ap_power_state = new_state; in apple_rtkit_management_rx_ap_pwr_ack()
222 complete_all(&rtk->ap_pwr_ack_completion); in apple_rtkit_management_rx_ap_pwr_ack()
225 static void apple_rtkit_management_rx(struct apple_rtkit *rtk, u64 msg) in apple_rtkit_management_rx() argument
231 apple_rtkit_management_rx_hello(rtk, msg); in apple_rtkit_management_rx()
234 apple_rtkit_management_rx_epmap(rtk, msg); in apple_rtkit_management_rx()
237 apple_rtkit_management_rx_iop_pwr_ack(rtk, msg); in apple_rtkit_management_rx()
240 apple_rtkit_management_rx_ap_pwr_ack(rtk, msg); in apple_rtkit_management_rx()
244 rtk->dev, in apple_rtkit_management_rx()
250 static int apple_rtkit_common_rx_get_buffer(struct apple_rtkit *rtk, in apple_rtkit_common_rx_get_buffer() argument
264 dev_dbg(rtk->dev, "RTKit: buffer request for 0x%zx bytes at %pad\n", in apple_rtkit_common_rx_get_buffer()
268 (!rtk->ops->shmem_setup || !rtk->ops->shmem_destroy)) { in apple_rtkit_common_rx_get_buffer()
273 if (rtk->ops->shmem_setup) { in apple_rtkit_common_rx_get_buffer()
274 err = rtk->ops->shmem_setup(rtk->cookie, buffer); in apple_rtkit_common_rx_get_buffer()
278 buffer->buffer = dma_alloc_coherent(rtk->dev, buffer->size, in apple_rtkit_common_rx_get_buffer()
292 apple_rtkit_send_message(rtk, ep, reply, NULL, false); in apple_rtkit_common_rx_get_buffer()
306 static void apple_rtkit_free_buffer(struct apple_rtkit *rtk, in apple_rtkit_free_buffer() argument
312 if (rtk->ops->shmem_destroy) in apple_rtkit_free_buffer()
313 rtk->ops->shmem_destroy(rtk->cookie, bfr); in apple_rtkit_free_buffer()
315 dma_free_coherent(rtk->dev, bfr->size, bfr->buffer, bfr->iova); in apple_rtkit_free_buffer()
324 static void apple_rtkit_memcpy(struct apple_rtkit *rtk, void *dst, in apple_rtkit_memcpy() argument
334 static void apple_rtkit_crashlog_rx(struct apple_rtkit *rtk, u64 msg) in apple_rtkit_crashlog_rx() argument
340 dev_warn(rtk->dev, "RTKit: Unknown crashlog message: %llx\n", in apple_rtkit_crashlog_rx()
345 if (!rtk->crashlog_buffer.size) { in apple_rtkit_crashlog_rx()
346 apple_rtkit_common_rx_get_buffer(rtk, &rtk->crashlog_buffer, in apple_rtkit_crashlog_rx()
351 dev_err(rtk->dev, "RTKit: co-processor has crashed\n"); in apple_rtkit_crashlog_rx()
358 bfr = kzalloc(rtk->crashlog_buffer.size, GFP_KERNEL); in apple_rtkit_crashlog_rx()
360 apple_rtkit_memcpy(rtk, bfr, &rtk->crashlog_buffer, 0, in apple_rtkit_crashlog_rx()
361 rtk->crashlog_buffer.size); in apple_rtkit_crashlog_rx()
362 apple_rtkit_crashlog_dump(rtk, bfr, rtk->crashlog_buffer.size); in apple_rtkit_crashlog_rx()
365 dev_err(rtk->dev, in apple_rtkit_crashlog_rx()
369 rtk->crashed = true; in apple_rtkit_crashlog_rx()
370 if (rtk->ops->crashed) in apple_rtkit_crashlog_rx()
371 rtk->ops->crashed(rtk->cookie); in apple_rtkit_crashlog_rx()
374 static void apple_rtkit_ioreport_rx(struct apple_rtkit *rtk, u64 msg) in apple_rtkit_ioreport_rx() argument
380 apple_rtkit_common_rx_get_buffer(rtk, &rtk->ioreport_buffer, in apple_rtkit_ioreport_rx()
386 apple_rtkit_send_message(rtk, APPLE_RTKIT_EP_IOREPORT, msg, in apple_rtkit_ioreport_rx()
390 dev_warn(rtk->dev, "RTKit: Unknown ioreport message: %llx\n", in apple_rtkit_ioreport_rx()
395 static void apple_rtkit_syslog_rx_init(struct apple_rtkit *rtk, u64 msg) in apple_rtkit_syslog_rx_init() argument
397 rtk->syslog_n_entries = FIELD_GET(APPLE_RTKIT_SYSLOG_N_ENTRIES, msg); in apple_rtkit_syslog_rx_init()
398 rtk->syslog_msg_size = FIELD_GET(APPLE_RTKIT_SYSLOG_MSG_SIZE, msg); in apple_rtkit_syslog_rx_init()
400 rtk->syslog_msg_buffer = kzalloc(rtk->syslog_msg_size, GFP_KERNEL); in apple_rtkit_syslog_rx_init()
402 dev_dbg(rtk->dev, in apple_rtkit_syslog_rx_init()
404 rtk->syslog_n_entries, rtk->syslog_msg_size); in apple_rtkit_syslog_rx_init()
412 static void apple_rtkit_syslog_rx_log(struct apple_rtkit *rtk, u64 msg) in apple_rtkit_syslog_rx_log() argument
416 size_t entry_size = 0x20 + rtk->syslog_msg_size; in apple_rtkit_syslog_rx_log()
419 if (!rtk->syslog_msg_buffer) { in apple_rtkit_syslog_rx_log()
421 rtk->dev, in apple_rtkit_syslog_rx_log()
425 if (!rtk->syslog_buffer.size) { in apple_rtkit_syslog_rx_log()
427 rtk->dev, in apple_rtkit_syslog_rx_log()
431 if (!rtk->syslog_buffer.buffer && !rtk->syslog_buffer.iomem) { in apple_rtkit_syslog_rx_log()
433 rtk->dev, in apple_rtkit_syslog_rx_log()
437 if (idx > rtk->syslog_n_entries) { in apple_rtkit_syslog_rx_log()
438 dev_warn(rtk->dev, "RTKit: syslog index %d out of range\n", in apple_rtkit_syslog_rx_log()
443 apple_rtkit_memcpy(rtk, log_context, &rtk->syslog_buffer, in apple_rtkit_syslog_rx_log()
445 apple_rtkit_memcpy(rtk, rtk->syslog_msg_buffer, &rtk->syslog_buffer, in apple_rtkit_syslog_rx_log()
447 rtk->syslog_msg_size); in apple_rtkit_syslog_rx_log()
451 msglen = rtk->syslog_msg_size - 1; in apple_rtkit_syslog_rx_log()
453 should_crop_syslog_char(rtk->syslog_msg_buffer[msglen - 1])) in apple_rtkit_syslog_rx_log()
456 rtk->syslog_msg_buffer[msglen] = 0; in apple_rtkit_syslog_rx_log()
457 dev_info(rtk->dev, "RTKit: syslog message: %s: %s\n", log_context, in apple_rtkit_syslog_rx_log()
458 rtk->syslog_msg_buffer); in apple_rtkit_syslog_rx_log()
461 apple_rtkit_send_message(rtk, APPLE_RTKIT_EP_SYSLOG, msg, NULL, false); in apple_rtkit_syslog_rx_log()
464 static void apple_rtkit_syslog_rx(struct apple_rtkit *rtk, u64 msg) in apple_rtkit_syslog_rx() argument
470 apple_rtkit_common_rx_get_buffer(rtk, &rtk->syslog_buffer, in apple_rtkit_syslog_rx()
474 apple_rtkit_syslog_rx_init(rtk, msg); in apple_rtkit_syslog_rx()
477 apple_rtkit_syslog_rx_log(rtk, msg); in apple_rtkit_syslog_rx()
480 dev_warn(rtk->dev, "RTKit: Unknown syslog message: %llx\n", in apple_rtkit_syslog_rx()
485 static void apple_rtkit_oslog_rx_init(struct apple_rtkit *rtk, u64 msg) in apple_rtkit_oslog_rx_init() argument
489 dev_dbg(rtk->dev, "RTKit: oslog init: msg: 0x%llx\n", msg); in apple_rtkit_oslog_rx_init()
491 apple_rtkit_send_message(rtk, APPLE_RTKIT_EP_OSLOG, ack, NULL, false); in apple_rtkit_oslog_rx_init()
494 static void apple_rtkit_oslog_rx(struct apple_rtkit *rtk, u64 msg) in apple_rtkit_oslog_rx() argument
500 apple_rtkit_oslog_rx_init(rtk, msg); in apple_rtkit_oslog_rx()
503 dev_warn(rtk->dev, "RTKit: Unknown oslog message: %llx\n", msg); in apple_rtkit_oslog_rx()
511 struct apple_rtkit *rtk = rtk_work->rtk; in apple_rtkit_rx_work() local
515 apple_rtkit_management_rx(rtk, rtk_work->msg); in apple_rtkit_rx_work()
518 apple_rtkit_crashlog_rx(rtk, rtk_work->msg); in apple_rtkit_rx_work()
521 apple_rtkit_syslog_rx(rtk, rtk_work->msg); in apple_rtkit_rx_work()
524 apple_rtkit_ioreport_rx(rtk, rtk_work->msg); in apple_rtkit_rx_work()
527 apple_rtkit_oslog_rx(rtk, rtk_work->msg); in apple_rtkit_rx_work()
530 if (rtk->ops->recv_message) in apple_rtkit_rx_work()
531 rtk->ops->recv_message(rtk->cookie, rtk_work->ep, in apple_rtkit_rx_work()
535 rtk->dev, in apple_rtkit_rx_work()
540 dev_warn(rtk->dev, in apple_rtkit_rx_work()
551 struct apple_rtkit *rtk = cookie; in apple_rtkit_rx() local
562 if (!test_bit(ep, rtk->endpoints)) in apple_rtkit_rx()
563 dev_warn(rtk->dev, in apple_rtkit_rx()
568 rtk->ops->recv_message_early && in apple_rtkit_rx()
569 rtk->ops->recv_message_early(rtk->cookie, ep, msg.msg0)) in apple_rtkit_rx()
576 work->rtk = rtk; in apple_rtkit_rx()
580 queue_work(rtk->wq, &work->work); in apple_rtkit_rx()
583 int apple_rtkit_send_message(struct apple_rtkit *rtk, u8 ep, u64 message, in apple_rtkit_send_message() argument
591 if (rtk->crashed) in apple_rtkit_send_message()
594 !apple_rtkit_is_running(rtk)) in apple_rtkit_send_message()
604 return apple_mbox_send(rtk->mbox, msg, atomic); in apple_rtkit_send_message()
608 int apple_rtkit_poll(struct apple_rtkit *rtk) in apple_rtkit_poll() argument
610 return apple_mbox_poll(rtk->mbox); in apple_rtkit_poll()
614 int apple_rtkit_start_ep(struct apple_rtkit *rtk, u8 endpoint) in apple_rtkit_start_ep() argument
618 if (!test_bit(endpoint, rtk->endpoints)) in apple_rtkit_start_ep()
621 !apple_rtkit_is_running(rtk)) in apple_rtkit_start_ep()
626 apple_rtkit_management_send(rtk, APPLE_RTKIT_MGMT_STARTEP, msg); in apple_rtkit_start_ep()
636 struct apple_rtkit *rtk; in apple_rtkit_init() local
642 rtk = kzalloc(sizeof(*rtk), GFP_KERNEL); in apple_rtkit_init()
643 if (!rtk) in apple_rtkit_init()
646 rtk->dev = dev; in apple_rtkit_init()
647 rtk->cookie = cookie; in apple_rtkit_init()
648 rtk->ops = ops; in apple_rtkit_init()
650 init_completion(&rtk->epmap_completion); in apple_rtkit_init()
651 init_completion(&rtk->iop_pwr_ack_completion); in apple_rtkit_init()
652 init_completion(&rtk->ap_pwr_ack_completion); in apple_rtkit_init()
654 bitmap_zero(rtk->endpoints, APPLE_RTKIT_MAX_ENDPOINTS); in apple_rtkit_init()
655 set_bit(APPLE_RTKIT_EP_MGMT, rtk->endpoints); in apple_rtkit_init()
658 rtk->mbox = apple_mbox_get_byname(dev, mbox_name); in apple_rtkit_init()
660 rtk->mbox = apple_mbox_get(dev, mbox_idx); in apple_rtkit_init()
662 if (IS_ERR(rtk->mbox)) { in apple_rtkit_init()
663 ret = PTR_ERR(rtk->mbox); in apple_rtkit_init()
667 rtk->mbox->rx = apple_rtkit_rx; in apple_rtkit_init()
668 rtk->mbox->cookie = rtk; in apple_rtkit_init()
670 rtk->wq = alloc_ordered_workqueue("rtkit-%s", WQ_MEM_RECLAIM, in apple_rtkit_init()
671 dev_name(rtk->dev)); in apple_rtkit_init()
672 if (!rtk->wq) { in apple_rtkit_init()
677 ret = apple_mbox_start(rtk->mbox); in apple_rtkit_init()
681 return rtk; in apple_rtkit_init()
684 destroy_workqueue(rtk->wq); in apple_rtkit_init()
686 kfree(rtk); in apple_rtkit_init()
705 int apple_rtkit_reinit(struct apple_rtkit *rtk) in apple_rtkit_reinit() argument
708 apple_mbox_stop(rtk->mbox); in apple_rtkit_reinit()
709 flush_workqueue(rtk->wq); in apple_rtkit_reinit()
711 apple_rtkit_free_buffer(rtk, &rtk->ioreport_buffer); in apple_rtkit_reinit()
712 apple_rtkit_free_buffer(rtk, &rtk->crashlog_buffer); in apple_rtkit_reinit()
713 apple_rtkit_free_buffer(rtk, &rtk->syslog_buffer); in apple_rtkit_reinit()
715 kfree(rtk->syslog_msg_buffer); in apple_rtkit_reinit()
717 rtk->syslog_msg_buffer = NULL; in apple_rtkit_reinit()
718 rtk->syslog_n_entries = 0; in apple_rtkit_reinit()
719 rtk->syslog_msg_size = 0; in apple_rtkit_reinit()
721 bitmap_zero(rtk->endpoints, APPLE_RTKIT_MAX_ENDPOINTS); in apple_rtkit_reinit()
722 set_bit(APPLE_RTKIT_EP_MGMT, rtk->endpoints); in apple_rtkit_reinit()
724 reinit_completion(&rtk->epmap_completion); in apple_rtkit_reinit()
725 reinit_completion(&rtk->iop_pwr_ack_completion); in apple_rtkit_reinit()
726 reinit_completion(&rtk->ap_pwr_ack_completion); in apple_rtkit_reinit()
728 rtk->crashed = false; in apple_rtkit_reinit()
729 rtk->iop_power_state = APPLE_RTKIT_PWR_STATE_OFF; in apple_rtkit_reinit()
730 rtk->ap_power_state = APPLE_RTKIT_PWR_STATE_OFF; in apple_rtkit_reinit()
732 return apple_mbox_start(rtk->mbox); in apple_rtkit_reinit()
736 static int apple_rtkit_set_ap_power_state(struct apple_rtkit *rtk, in apple_rtkit_set_ap_power_state() argument
742 reinit_completion(&rtk->ap_pwr_ack_completion); in apple_rtkit_set_ap_power_state()
745 apple_rtkit_management_send(rtk, APPLE_RTKIT_MGMT_SET_AP_PWR_STATE, in apple_rtkit_set_ap_power_state()
748 ret = apple_rtkit_wait_for_completion(&rtk->ap_pwr_ack_completion); in apple_rtkit_set_ap_power_state()
752 if (rtk->ap_power_state != state) in apple_rtkit_set_ap_power_state()
757 static int apple_rtkit_set_iop_power_state(struct apple_rtkit *rtk, in apple_rtkit_set_iop_power_state() argument
763 reinit_completion(&rtk->iop_pwr_ack_completion); in apple_rtkit_set_iop_power_state()
766 apple_rtkit_management_send(rtk, APPLE_RTKIT_MGMT_SET_IOP_PWR_STATE, in apple_rtkit_set_iop_power_state()
769 ret = apple_rtkit_wait_for_completion(&rtk->iop_pwr_ack_completion); in apple_rtkit_set_iop_power_state()
773 if (rtk->iop_power_state != state) in apple_rtkit_set_iop_power_state()
778 int apple_rtkit_boot(struct apple_rtkit *rtk) in apple_rtkit_boot() argument
782 if (apple_rtkit_is_running(rtk)) in apple_rtkit_boot()
784 if (rtk->crashed) in apple_rtkit_boot()
787 dev_dbg(rtk->dev, "RTKit: waiting for boot to finish\n"); in apple_rtkit_boot()
788 ret = apple_rtkit_wait_for_completion(&rtk->epmap_completion); in apple_rtkit_boot()
791 if (rtk->boot_result) in apple_rtkit_boot()
792 return rtk->boot_result; in apple_rtkit_boot()
794 dev_dbg(rtk->dev, "RTKit: waiting for IOP power state ACK\n"); in apple_rtkit_boot()
795 ret = apple_rtkit_wait_for_completion(&rtk->iop_pwr_ack_completion); in apple_rtkit_boot()
799 return apple_rtkit_set_ap_power_state(rtk, APPLE_RTKIT_PWR_STATE_ON); in apple_rtkit_boot()
803 int apple_rtkit_shutdown(struct apple_rtkit *rtk) in apple_rtkit_shutdown() argument
808 ret = apple_rtkit_set_ap_power_state(rtk, in apple_rtkit_shutdown()
813 ret = apple_rtkit_set_iop_power_state(rtk, APPLE_RTKIT_PWR_STATE_SLEEP); in apple_rtkit_shutdown()
817 return apple_rtkit_reinit(rtk); in apple_rtkit_shutdown()
821 int apple_rtkit_idle(struct apple_rtkit *rtk) in apple_rtkit_idle() argument
826 ret = apple_rtkit_set_ap_power_state(rtk, in apple_rtkit_idle()
831 ret = apple_rtkit_set_iop_power_state(rtk, APPLE_RTKIT_PWR_STATE_IDLE); in apple_rtkit_idle()
835 rtk->iop_power_state = APPLE_RTKIT_PWR_STATE_IDLE; in apple_rtkit_idle()
836 rtk->ap_power_state = APPLE_RTKIT_PWR_STATE_IDLE; in apple_rtkit_idle()
841 int apple_rtkit_quiesce(struct apple_rtkit *rtk) in apple_rtkit_quiesce() argument
845 ret = apple_rtkit_set_ap_power_state(rtk, in apple_rtkit_quiesce()
850 ret = apple_rtkit_set_iop_power_state(rtk, in apple_rtkit_quiesce()
855 ret = apple_rtkit_reinit(rtk); in apple_rtkit_quiesce()
859 rtk->iop_power_state = APPLE_RTKIT_PWR_STATE_QUIESCED; in apple_rtkit_quiesce()
860 rtk->ap_power_state = APPLE_RTKIT_PWR_STATE_QUIESCED; in apple_rtkit_quiesce()
865 int apple_rtkit_wake(struct apple_rtkit *rtk) in apple_rtkit_wake() argument
869 if (apple_rtkit_is_running(rtk)) in apple_rtkit_wake()
872 reinit_completion(&rtk->iop_pwr_ack_completion); in apple_rtkit_wake()
879 apple_rtkit_management_send(rtk, APPLE_RTKIT_MGMT_SET_IOP_PWR_STATE, in apple_rtkit_wake()
882 return apple_rtkit_boot(rtk); in apple_rtkit_wake()
886 void apple_rtkit_free(struct apple_rtkit *rtk) in apple_rtkit_free() argument
888 apple_mbox_stop(rtk->mbox); in apple_rtkit_free()
889 destroy_workqueue(rtk->wq); in apple_rtkit_free()
891 apple_rtkit_free_buffer(rtk, &rtk->ioreport_buffer); in apple_rtkit_free()
892 apple_rtkit_free_buffer(rtk, &rtk->crashlog_buffer); in apple_rtkit_free()
893 apple_rtkit_free_buffer(rtk, &rtk->syslog_buffer); in apple_rtkit_free()
895 kfree(rtk->syslog_msg_buffer); in apple_rtkit_free()
896 kfree(rtk); in apple_rtkit_free()
909 struct apple_rtkit *rtk; in devm_apple_rtkit_init() local
912 rtk = apple_rtkit_init(dev, cookie, mbox_name, mbox_idx, ops); in devm_apple_rtkit_init()
913 if (IS_ERR(rtk)) in devm_apple_rtkit_init()
914 return rtk; in devm_apple_rtkit_init()
916 ret = devm_add_action_or_reset(dev, apple_rtkit_free_wrapper, rtk); in devm_apple_rtkit_init()
920 return rtk; in devm_apple_rtkit_init()