Commit e6695c89 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

media: exynos-gsc: don't resume at remove time



Calling pm_runtime_get_sync() at driver's removal time is not
needed, as this will resume PM runtime. Also, the PM runtime
code at pm_runtime_disable() already calls it, if it detects
the need.

So, change the logic in order to disable PM runtime earlier.

Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 62c90446
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -1210,17 +1210,18 @@ static int gsc_remove(struct platform_device *pdev)
	struct gsc_dev *gsc = platform_get_drvdata(pdev);
	int i;

	pm_runtime_get_sync(&pdev->dev);

	gsc_unregister_m2m_device(gsc);
	v4l2_device_unregister(&gsc->v4l2_dev);

	vb2_dma_contig_clear_max_seg_size(&pdev->dev);

	pm_runtime_disable(&pdev->dev);

	if (!pm_runtime_status_suspended(&pdev->dev))
		for (i = 0; i < gsc->num_clocks; i++)
			clk_disable_unprepare(gsc->clock[i]);

	pm_runtime_put_noidle(&pdev->dev);
	pm_runtime_disable(&pdev->dev);
	pm_runtime_set_suspended(&pdev->dev);

	dev_dbg(&pdev->dev, "%s driver unloaded\n", pdev->name);
	return 0;