---
title: HwDeactivate
framework: serialdriverkit
role: symbol
role_heading: Instance Method
path: serialdriverkit/iouserserial/hwdeactivate
---

# HwDeactivate

Closes the communication channel to the device.

## Declaration

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

## Return Value

Return Value kIOReturnSuccess on success, or another value if an error occurs. See Error Codes.

## Discussion

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.

## See Also

### Activating and Deactivating the Service

- [HwActivate](serialdriverkit/iouserserial/hwactivate.md)
