From: Phong Tran Date: Fri, 3 Apr 2015 14:07:01 +0000 (+0700) Subject: staging: android: ion_test: unregister the misc device X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=954c2d8f982fe188740f11cb4a00881d5325e89e;p=openwrt%2Fstaging%2Fblogic.git staging: android: ion_test: unregister the misc device Add the remove() method for deregister from misc device when it's unloaded. Signed-off-by: Phong Tran Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/android/ion/ion_test.c b/drivers/staging/android/ion/ion_test.c index 3bc461cbbfa3..052d5e2177e7 100644 --- a/drivers/staging/android/ion/ion_test.c +++ b/drivers/staging/android/ion/ion_test.c @@ -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", },