You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
@@ -1226,7 +1226,7 @@ static int tegra_hdmi_probe(struct platform_device *pdev)
|
||||
|
||||
hdmi->output.dev = &pdev->dev;
|
||||
|
||||
err = tegra_output_parse_dt(&hdmi->output);
|
||||
err = tegra_output_probe(&hdmi->output);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
@@ -1272,6 +1272,12 @@ static int tegra_hdmi_remove(struct platform_device *pdev)
|
||||
return err;
|
||||
}
|
||||
|
||||
err = tegra_output_remove(&hdmi->output);
|
||||
if (err < 0) {
|
||||
dev_err(&pdev->dev, "failed to remove output: %d\n", err);
|
||||
return err;
|
||||
}
|
||||
|
||||
clk_unprepare(hdmi->clk_parent);
|
||||
clk_unprepare(hdmi->clk);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user