diff --git a/drivers/media/platform/msm/cvp/cvp.c b/drivers/media/platform/msm/cvp/cvp.c index cf3e4b530d99..87adb4fbd975 100644 --- a/drivers/media/platform/msm/cvp/cvp.c +++ b/drivers/media/platform/msm/cvp/cvp.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. */ #include @@ -491,7 +492,11 @@ static int msm_cvp_remove(struct platform_device *pdev) return -EINVAL; } - core = dev_get_drvdata(&pdev->dev); + if (of_device_is_compatible(pdev->dev.of_node, "qcom,msm-cvp")) + core = dev_get_drvdata(&pdev->dev); + else + core = dev_get_drvdata(pdev->dev.parent); + if (!core) { dprintk(CVP_ERR, "%s invalid core", __func__); return -EINVAL;