summaryrefslogtreecommitdiff
path: root/io-module
diff options
context:
space:
mode:
Diffstat (limited to 'io-module')
-rw-r--r--io-module/mts_io.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/io-module/mts_io.c b/io-module/mts_io.c
index 2d60a6d..cbf0637 100644
--- a/io-module/mts_io.c
+++ b/io-module/mts_io.c
@@ -507,8 +507,10 @@ static void cleanup(void)
int port_index;
log_info("cleaning up....");
- sysfs_remove_link(&mts_io_platform_device->dev.parent->kobj, "mtcdp");
- platform_device_unregister(mts_io_platform_device);
+ if (mts_io_platform_device) {
+ sysfs_remove_link(&mts_io_platform_device->dev.parent->kobj, "mtcdp");
+ platform_device_unregister(mts_io_platform_device);
+ }
for (port_index = 0, port = 1; port_index < NUM_AP; port_index++, port++) {
if (port_info[port_index]) {
port_info[port_index]->teardown(port);