]> git.baikalelectronics.ru Git - kernel.git/commit
drm/tegra: Allocate resources at probe time
authorThierry Reding <treding@nvidia.com>
Mon, 14 Oct 2013 12:26:42 +0000 (14:26 +0200)
committerThierry Reding <treding@nvidia.com>
Thu, 31 Oct 2013 08:55:41 +0000 (09:55 +0100)
commite72e43ba0ad0945bedf83db132d176a7cf49db01
tree47158501586464399b9dd50da13cb7265166d7d3
parent07574ebc8ff5db352b753ba9adce67f1cc26266a
drm/tegra: Allocate resources at probe time

Since the .init() and .exit() functions are executed whenever the DRM
driver is loaded or unloaded, care must be taken not to use them for
resource allocation. Otherwise deferred probing cannot be used, since
the .init() and .exit() are not run at probe time. Similarly the code
that frees resources must be run at .remove() time. If it is run from
the .exit() function, it can release resources multiple times.

To handle this more consistently, rename the tegra_output_parse_dt()
function to tegra_output_probe() and introduce tegra_output_remove()
which can be used to free output-related resources.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/tegra/dc.c
drivers/gpu/drm/tegra/drm.h
drivers/gpu/drm/tegra/hdmi.c
drivers/gpu/drm/tegra/output.c
drivers/gpu/drm/tegra/rgb.c