The cleanup paths don't destroy the iommu mapping, so they linger around when
init fails.
BUG=none
TEST=compiles, still works on snow
Change-Id: Ieef610db22154d37d307f4a589bd0830ef3fb97c
Reviewed-on: https://gerrit.chromium.org/gerrit/40410
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Commit-Queue: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Pawel Osciak <posciak@chromium.org>
static int exynos_drm_platform_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
+ int ret;
DRM_DEBUG_DRIVER("%s\n", __FILE__);
pm_runtime_enable(dev);
pm_runtime_get_sync(dev);
- return drm_platform_init(&exynos_drm_driver, pdev);
+ ret = drm_platform_init(&exynos_drm_driver, pdev);
+#ifdef CONFIG_EXYNOS_IOMMU
+ if (ret)
+ iommu_deinit(pdev);
+#endif
+
+ return ret;
}
static int __devexit exynos_drm_platform_remove(struct platform_device *pdev)
return 0;
}
+
+static void iommu_deinit(struct platform_device *pdev)
+{
+ s5p_destroy_iommu_mapping(&pdev->dev);
+ DRM_DEBUG("released the IOMMU mapping\n");
+}
#endif
static int __devinit mixer_resources_init_exynos(
mixer_resource_poweroff(mctx);
mixer_resources_cleanup(dev, mctx);
+#ifdef CONFIG_EXYNOS_IOMMU
+ iommu_deinit(pdev);
+#endif
+
kfree(mctx);
return 0;