diff --git a/sound/soc/codecs/wcd-kdt_sample-v2.c b/sound/soc/codecs/wcd-kdt_sample-v2.c
index dba66e5..22b38ec 100644
--- a/sound/soc/codecs/wcd-kdt_sample-v2.c
+++ b/sound/soc/codecs/wcd-kdt_sample-v2.c
@@ -2484,9 +2484,6 @@
{
struct snd_soc_codec *codec = kdt_sample->codec;
-#ifdef CONFIG_KDT_RPI_SAMPLE
- switch_dev_unregister(&kdt_sample->sdev);
-#endif //CONFIG_KDT_RPI_SAMPLE
kdt_sample->kdt_sample_cb->free_irq(codec, kdt_sample->intr_ids->kdt_sample_sw_intr, kdt_sample);
kdt_sample->kdt_sample_cb->free_irq(codec, kdt_sample->intr_ids->kdt_sample_btn_press_intr,
kdt_sample);
@@ -2496,6 +2493,14 @@
kdt_sample->kdt_sample_cb->free_irq(codec, kdt_sample->intr_ids->kdt_sample_hs_rem_intr, kdt_sample);
kdt_sample->kdt_sample_cb->free_irq(codec, kdt_sample->intr_ids->hph_left_ocp, kdt_sample);
kdt_sample->kdt_sample_cb->free_irq(codec, kdt_sample->intr_ids->hph_right_ocp, kdt_sample);
+#ifdef CONFIG_KDT_RPI_SAMPLE
+ //switch_dev_unregister(&kdt_sample->sdev);
+ if (kdt_sample->sdev.name){
+ switch_dev_unregister(&kdt_sample->sdev);
+ memset(&kdt_sample->sdev, 0, sizeof(struct switch_dev));
+
+ }
+#endif //CONFIG_KDT_RPI_SAMPLE
if (kdt_sample->kdt_sample_cb && kdt_sample->kdt_sample_cb->register_notifier)
kdt_sample->kdt_sample_cb->register_notifier(codec, &kdt_sample->nblock, false);
mutex_destroy(&kdt_sample->codec_resource_lock);
'Core BSP 분석 > 커널 트러블슈팅' 카테고리의 다른 글
[Troubleshooting] dump_stack() : SP가 0으로 출력되는 이유 (0) | 2023.05.07 |
---|---|
QEMU - Aarch64 (0) | 2023.05.07 |
[커널크래시] 인터럽트 컨텍스트에서 wake_up_interruptible 대신 wake_up_locked 사용 (0) | 2023.05.07 |
[리눅스커널] 커널 크래시: Data Abort @usb_copy_descriptors (0) | 2023.05.07 |
[리눅스커널] 익명 페이지 메모리 누수(Memory Leak) 디버깅 - TRACE32 (0) | 2023.05.07 |