diff --git a/drivers/media/pci/intel/ipu-isys.c b/drivers/media/pci/intel/ipu-isys.c index 24c0af786a49..eb4fba3a0a80 100644 --- a/drivers/media/pci/intel/ipu-isys.c +++ b/drivers/media/pci/intel/ipu-isys.c @@ -1170,8 +1170,7 @@ static void isys_remove(struct ipu_bus_device *adev) dev_info(&adev->dev, "removed\n"); #ifdef CONFIG_DEBUG_FS - if (isp->ipu_dir) - debugfs_remove_recursive(isys->debugfsdir); + debugfs_remove_recursive(isys->debugfsdir); #endif list_for_each_entry_safe(fwmsg, safe, &isys->framebuflist, head) { @@ -1217,6 +1216,7 @@ static void isys_remove(struct ipu_bus_device *adev) mutex_destroy(&isys->stream_mutex); mutex_destroy(&isys->mutex); + mutex_destroy(&isys->lib_mutex); if (isys->short_packet_source == IPU_ISYS_SHORT_PACKET_FROM_TUNIT) { u32 trace_size = IPU_ISYS_SHORT_PACKET_TRACE_BUFFER_SIZE; @@ -1587,7 +1587,15 @@ static int isys_probe(struct ipu_bus_device *adev) isys_iwake_watermark_cleanup(isys); isys_unregister_devices(isys); out_remove_pkg_dir_shared_buffer: +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0) cpu_latency_qos_remove_request(&isys->pm_qos); +#else + pm_qos_remove_request(&isys->pm_qos); +#endif + ipu_trace_uninit(&adev->dev); +#ifdef CONFIG_DEBUG_FS + debugfs_remove_recursive(isys->debugfsdir); +#endif if (!isp->secure_mode) ipu_cpd_free_pkg_dir(adev, isys->pkg_dir, isys->pkg_dir_dma_addr, @@ -1598,10 +1606,10 @@ static int isys_probe(struct ipu_bus_device *adev) release_firmware: if (!isp->secure_mode) release_firmware(isys->fw); - ipu_trace_uninit(&adev->dev); mutex_destroy(&isys->mutex); mutex_destroy(&isys->stream_mutex); + mutex_destroy(&isys->lib_mutex); if (isys->short_packet_source == IPU_ISYS_SHORT_PACKET_FROM_TUNIT) mutex_destroy(&isys->short_packet_tracing_mutex);