<!--
{
  "availability" : [
    "DriverKit: 19.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SerialDriverKit",
  "identifier" : "/documentation/SerialDriverKit/IOUserSerial/HwDeactivate",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SerialDriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOUserSerial@F@HwDeactivate#"
  },
  "title" : "HwDeactivate"
}
-->

# HwDeactivate

Closes the communication channel to the device.

```
virtual kern_return_t HwDeactivate();
```

## Return Value

<doc://com.apple.documentation/documentation/DriverKit/kIOReturnSuccess> on success, or another value if an error occurs. See <doc://com.apple.documentation/documentation/DriverKit/error-codes>.

## Discussion

Override this method as needed and use it to close the connection to your device’s hardware. Always call the `super` version of the method at the end of your implementation.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)