diff options
author | Phong Tran <tranmanphong@gmail.com> | 2015-04-03 21:07:01 +0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-05-08 09:24:08 +0200 |
commit | 954c2d8f982fe188740f11cb4a00881d5325e89e (patch) | |
tree | 29ec3b9071c2a2ce57141e044a7c637cc96db8c2 /drivers/staging/android | |
parent | a569f22007f51db92304af05cda096ae1ad8844f (diff) | |
download | op-kernel-dev-954c2d8f982fe188740f11cb4a00881d5325e89e.zip op-kernel-dev-954c2d8f982fe188740f11cb4a00881d5325e89e.tar.gz |
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 <tranmanphong@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/android')
-rw-r--r-- | drivers/staging/android/ion/ion_test.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/staging/android/ion/ion_test.c b/drivers/staging/android/ion/ion_test.c index 3bc461c..052d5e2 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", }, |