[PATCH 4/6] gpu: drm: tegra: Free platform data on remove

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Arto Merilainen <amerilainen@xxxxxxxxxx>

Platform data was not freed in device removal. This patch adds
missing devm_kfree() calls.

Change-Id: Id00fd1940e786dbc80c7ac5a1bd4d6a4c18720a1
Signed-off-by: Arto Merilainen <amerilainen@xxxxxxxxxx>
Signed-off-by: Terje Bergstrom <tbergstrom@xxxxxxxxxx>
---
 drivers/gpu/drm/tegra/dc.c   |    3 +++
 drivers/gpu/drm/tegra/dsi.c  |    3 +++
 drivers/gpu/drm/tegra/hdmi.c |    3 +++
 drivers/gpu/drm/tegra/tvo.c  |    3 +++
 4 files changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 5ccb809..b9e5a79 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -818,6 +818,9 @@ static int tegra_dc_remove(struct platform_device *pdev)
 
 	clk_disable_unprepare(dc->clk);
 
+	platform_set_drvdata(pdev, NULL);
+	devm_kfree(&pdev->dev, dc);
+
 	return 0;
 }
 
diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c
index 4f4c709..bba1c61 100644
--- a/drivers/gpu/drm/tegra/dsi.c
+++ b/drivers/gpu/drm/tegra/dsi.c
@@ -149,6 +149,9 @@ static int tegra_dsi_remove(struct platform_device *pdev)
 		return err;
 	}
 
+	platform_set_drvdata(pdev, NULL);
+	devm_kfree(&pdev->dev, dsi);
+
 	return 0;
 }
 
diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
index b2b8e58..72032e8 100644
--- a/drivers/gpu/drm/tegra/hdmi.c
+++ b/drivers/gpu/drm/tegra/hdmi.c
@@ -1312,6 +1312,9 @@ static int tegra_hdmi_remove(struct platform_device *pdev)
 	clk_unprepare(hdmi->clk_parent);
 	clk_unprepare(hdmi->clk);
 
+	platform_set_drvdata(pdev, NULL);
+	devm_kfree(&pdev->dev, hdmi);
+
 	return 0;
 }
 
diff --git a/drivers/gpu/drm/tegra/tvo.c b/drivers/gpu/drm/tegra/tvo.c
index 01ac356..c6219b3 100644
--- a/drivers/gpu/drm/tegra/tvo.c
+++ b/drivers/gpu/drm/tegra/tvo.c
@@ -159,6 +159,9 @@ static int tegra_tvo_remove(struct platform_device *pdev)
 		return err;
 	}
 
+	platform_set_drvdata(pdev, NULL);
+	devm_kfree(&pdev->dev, tvo);
+
 	return 0;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux