[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1409055038-9204-1-git-send-email-pramod.gurav@smartplayin.com>
Date: Tue, 26 Aug 2014 17:40:37 +0530
From: Pramod Gurav <pramod.gurav@...rtplayin.com>
To: linux-kernel@...r.kernel.org, linux-fbdev@...r.kernel.org
Cc: Pramod Gurav <pramod.gurav@...rtplayin.com>,
Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>,
Tomi Valkeinen <tomi.valkeinen@...com>,
Stephen Boyd <sboyd@...eaurora.org>,
Jingoo Han <jg1.han@...sung.com>,
Rob Clark <robdclark@...il.com>
Subject: [PATCH v2 1/2] msm: msm_fb: Add remove function for platform driver for clean unloading
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@...rtplayin.com>
CC: Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>
CC: Tomi Valkeinen <tomi.valkeinen@...com>
CC: Stephen Boyd <sboyd@...eaurora.org>
CC: Jingoo Han <jg1.han@...sung.com>
CC: Rob Clark <robdclark@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists