Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0c46575f authored by Pramod Gurav's avatar Pramod Gurav Committed by Tomi Valkeinen
Browse files

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: default avatarPramod 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>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 87306c1d
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -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 @@ static int msmfb_probe(struct platform_device *pdev)
	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"},
};