summaryrefslogtreecommitdiff
path: root/drivers/switch
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/switch')
-rw-r--r--drivers/switch/switch_class.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/switch/switch_class.c b/drivers/switch/switch_class.c
index e05fc2591147..2c94752f6459 100644
--- a/drivers/switch/switch_class.c
+++ b/drivers/switch/switch_class.c
@@ -2,6 +2,7 @@
* drivers/switch/switch_class.c
*
* Copyright (C) 2008 Google, Inc.
+ * Copyright (C) 2012 - NVIDIA, Inc.
* Author: Mike Lockwood <lockwood@android.com>
*
* This software is licensed under the terms of the GNU General Public
@@ -151,8 +152,8 @@ void switch_dev_unregister(struct switch_dev *sdev)
{
device_remove_file(sdev->dev, &dev_attr_name);
device_remove_file(sdev->dev, &dev_attr_state);
- device_destroy(switch_class, MKDEV(0, sdev->index));
dev_set_drvdata(sdev->dev, NULL);
+ device_destroy(switch_class, MKDEV(0, sdev->index));
}
EXPORT_SYMBOL_GPL(switch_dev_unregister);