summaryrefslogtreecommitdiff
path: root/components/drivers
diff options
context:
space:
mode:
authoriysheng <[email protected]>2021-03-18 10:51:50 +0800
committeriysheng <[email protected]>2021-03-18 10:51:50 +0800
commitfcffea45018e81e5bfdb16dfb77a60a66405df00 (patch)
tree8dd23afc53efd0bcf73f6974b1a105553d17a3f7 /components/drivers
parent6de81af04cbef6825f1d0d9921bacc59df2c7189 (diff)
[components][serial] fix do RT_DEVICE_CTRL_CLOSE cmd when close serial device regardless of DMA config
Diffstat (limited to 'components/drivers')
-rw-r--r--components/drivers/serial/serial.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c
index d9a20f05a0..32161ad0cb 100644
--- a/components/drivers/serial/serial.c
+++ b/components/drivers/serial/serial.c
@@ -816,11 +816,11 @@ static rt_err_t rt_serial_close(struct rt_device *dev)
/* configure low level device */
serial->ops->control(serial, RT_DEVICE_CTRL_CLR_INT, (void *) RT_DEVICE_FLAG_DMA_TX);
}
+#endif /* RT_SERIAL_USING_DMA */
serial->ops->control(serial, RT_DEVICE_CTRL_CLOSE, RT_NULL);
dev->flag &= ~RT_DEVICE_FLAG_ACTIVATED;
-#endif /* RT_SERIAL_USING_DMA */
return RT_EOK;
}