All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] msm: msm_fb: Add remove function for platform driver for clean unloading
@ 2014-08-26 12:22 ` Pramod Gurav
  0 siblings, 0 replies; 4+ messages in thread
From: Pramod Gurav @ 2014-08-26 12:10 UTC (permalink / raw)
  To: linux-kernel, linux-fbdev
  Cc: Pramod Gurav, Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
	Stephen Boyd, Jingoo Han, Rob Clark

This adds a  remove function to platform driver structure so that
resources are released when driver is unloaded.

Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>

CC: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
CC: Tomi Valkeinen <tomi.valkeinen@ti.com>
CC: Stephen Boyd <sboyd@codeaurora.org>
CC: Jingoo Han <jg1.han@samsung.com>
CC: Rob Clark <robdclark@gmail.com>

---
 drivers/video/fbdev/msm/msm_fb.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/video/fbdev/msm/msm_fb.c b/drivers/video/fbdev/msm/msm_fb.c
index 1374803..4640188 100644
--- a/drivers/video/fbdev/msm/msm_fb.c
+++ b/drivers/video/fbdev/msm/msm_fb.c
@@ -589,6 +589,8 @@ static int msmfb_probe(struct platform_device *pdev)
 
 	msmfb->sleeping = WAKING;
 
+	platform_set_drvdata(pdev, msmfb);
+
 	return 0;
 
 error_register_framebuffer:
@@ -598,9 +600,23 @@ error_setup_fbmem:
 	return ret;
 }
 
+static int msmfb_remove(struct platform_device *pdev)
+{
+	struct msmfb_info *msmfb;
+
+	msmfb = platform_get_drvdata(pdev);
+
+	unregister_framebuffer(msmfb->fb);
+	iounmap(msmfb->fb->screen_base);
+	framebuffer_release(msmfb->fb);
+
+	return 0;
+}
+
 static struct platform_driver msm_panel_driver = {
 	/* need to write remove */
 	.probe = msmfb_probe,
+	.remove = msmfb_remove,
 	.driver = {.name = "msm_panel"},
 };
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 1/2] msm: msm_fb: Add remove function for platform driver for clean unloading
@ 2014-08-26 12:22 ` Pramod Gurav
  0 siblings, 0 replies; 4+ messages in thread
From: Pramod Gurav @ 2014-08-26 12:22 UTC (permalink / raw)
  To: linux-kernel, linux-fbdev
  Cc: Pramod Gurav, Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
	Stephen Boyd, Jingoo Han, Rob Clark

This adds a  remove function to platform driver structure so that
resources are released when driver is unloaded.

Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>

CC: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
CC: Tomi Valkeinen <tomi.valkeinen@ti.com>
CC: Stephen Boyd <sboyd@codeaurora.org>
CC: Jingoo Han <jg1.han@samsung.com>
CC: Rob Clark <robdclark@gmail.com>

---
 drivers/video/fbdev/msm/msm_fb.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/video/fbdev/msm/msm_fb.c b/drivers/video/fbdev/msm/msm_fb.c
index 1374803..4640188 100644
--- a/drivers/video/fbdev/msm/msm_fb.c
+++ b/drivers/video/fbdev/msm/msm_fb.c
@@ -589,6 +589,8 @@ static int msmfb_probe(struct platform_device *pdev)
 
 	msmfb->sleeping = WAKING;
 
+	platform_set_drvdata(pdev, msmfb);
+
 	return 0;
 
 error_register_framebuffer:
@@ -598,9 +600,23 @@ error_setup_fbmem:
 	return ret;
 }
 
+static int msmfb_remove(struct platform_device *pdev)
+{
+	struct msmfb_info *msmfb;
+
+	msmfb = platform_get_drvdata(pdev);
+
+	unregister_framebuffer(msmfb->fb);
+	iounmap(msmfb->fb->screen_base);
+	framebuffer_release(msmfb->fb);
+
+	return 0;
+}
+
 static struct platform_driver msm_panel_driver = {
 	/* need to write remove */
 	.probe = msmfb_probe,
+	.remove = msmfb_remove,
 	.driver = {.name = "msm_panel"},
 };
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 1/2] msm: msm_fb: Add remove function for platform driver for clean unloading
  2014-08-26 12:22 ` Pramod Gurav
@ 2014-08-26 12:52   ` Tomi Valkeinen
  -1 siblings, 0 replies; 4+ messages in thread
From: Tomi Valkeinen @ 2014-08-26 12:52 UTC (permalink / raw)
  To: Pramod Gurav, linux-kernel, linux-fbdev
  Cc: Jean-Christophe Plagniol-Villard, Stephen Boyd, Jingoo Han, Rob Clark

[-- Attachment #1: Type: text/plain, Size: 283 bytes --]

On 26/08/14 15:10, Pramod Gurav wrote:
> This adds a  remove function to platform driver structure so that
> resources are released when driver is unloaded.
> 
> Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
> 

Thanks, queued this series for 3.18.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 1/2] msm: msm_fb: Add remove function for platform driver for clean unloading
@ 2014-08-26 12:52   ` Tomi Valkeinen
  0 siblings, 0 replies; 4+ messages in thread
From: Tomi Valkeinen @ 2014-08-26 12:52 UTC (permalink / raw)
  To: Pramod Gurav, linux-kernel, linux-fbdev
  Cc: Jean-Christophe Plagniol-Villard, Stephen Boyd, Jingoo Han, Rob Clark

[-- Attachment #1: Type: text/plain, Size: 283 bytes --]

On 26/08/14 15:10, Pramod Gurav wrote:
> This adds a  remove function to platform driver structure so that
> resources are released when driver is unloaded.
> 
> Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
> 

Thanks, queued this series for 3.18.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-08-26 12:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-26 12:10 [PATCH v2 1/2] msm: msm_fb: Add remove function for platform driver for clean unloading Pramod Gurav
2014-08-26 12:22 ` Pramod Gurav
2014-08-26 12:52 ` Tomi Valkeinen
2014-08-26 12:52   ` Tomi Valkeinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.