]> git.kernelconcepts.de Git - karo-tx-linux.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>
Wed, 16 Oct 2013 18:02:59 +0000 (20:02 +0200)
commit578e249856a328178f4ba924eab54b0776c7c7dd
tree47158501586464399b9dd50da13cb7265166d7d3
parentc0fc4e8db1d1cae4d06923281b38489c823bbb81
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