Commit 954c2d8f authored by Phong Tran's avatar Phong Tran Committed by Greg Kroah-Hartman
Browse files

staging: android: ion_test: unregister the misc device



Add the remove() method for deregister from misc device
when it's unloaded.

Signed-off-by: default avatarPhong Tran <tranmanphong@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a569f220
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -261,7 +261,19 @@ static int __init ion_test_probe(struct platform_device *pdev)
	return 0;
}

static int ion_test_remove(struct platform_device *pdev)
{
	struct ion_test_device *testdev;

	testdev = platform_get_drvdata(pdev);
	if (!testdev)
		return -ENODATA;

	return misc_deregister(&testdev->misc);
}

static struct platform_driver ion_test_platform_driver = {
	.remove = ion_test_remove,
	.driver = {
		.name = "ion-test",
	},