[PATCH 1/6] staging: kpc2000_dma: added Kconfig to enable asynchronous I/O.

Jeremy Sowden jeremy at azazel.net
Tue Jun 11 19:50:59 UTC 2019


The DMA driver has call-backs for doing asynchronous I/O which are
protected by a CONFIG_ macro which is not defined.  Added a Kconfig
stanza to define it.

Cc: Matt Sickler <matt.sickler at daktronics.com>
Signed-off-by: Jeremy Sowden <jeremy at azazel.net>
---
 drivers/staging/kpc2000/Kconfig           | 8 ++++++++
 drivers/staging/kpc2000/kpc_dma/fileops.c | 6 +++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/kpc2000/Kconfig b/drivers/staging/kpc2000/Kconfig
index 897965359fcb..694cef28c1b3 100644
--- a/drivers/staging/kpc2000/Kconfig
+++ b/drivers/staging/kpc2000/Kconfig
@@ -57,3 +57,11 @@ config KPC2000_DMA
 
 	  If unsure, say N.
 
+config KPC2000_DMA_AIO
+	bool "Daktronics KPC DMA controller (asynchronous IO)"
+	depends on KPC2000_DMA && AIO
+	help
+          Say Y here if you wish to support asynchronous IO with the Daktronics
+          DMA controller.
+
+	  If unsure, say N.
diff --git a/drivers/staging/kpc2000/kpc_dma/fileops.c b/drivers/staging/kpc2000/kpc_dma/fileops.c
index f80b01715d93..ee382dee01ca 100644
--- a/drivers/staging/kpc2000/kpc_dma/fileops.c
+++ b/drivers/staging/kpc2000/kpc_dma/fileops.c
@@ -242,7 +242,7 @@ void  transfer_complete_cb(struct aio_cb_data *acd, size_t xfr_count, u32 flags)
 			kfree(acd);
 		}
 	} else {
-#ifdef CONFIG_KPC_DMA_AIO
+#ifdef CONFIG_KPC2000_DMA_AIO
 		aio_complete(acd->kcb, acd->len, acd->flags);
 #endif
 		kfree(acd);
@@ -308,7 +308,7 @@ int  kpc_dma_close(struct inode *inode, struct file *filp)
 	return 0;
 }
 
-#ifdef CONFIG_KPC_DMA_AIO
+#ifdef CONFIG_KPC2000_DMA_AIO
 static
 int  kpc_dma_aio_cancel(struct kiocb *kcb)
 {
@@ -402,7 +402,7 @@ const struct file_operations  kpc_dma_fops = {
 	.release        = kpc_dma_close,
 	.read           = kpc_dma_read,
 	.write          = kpc_dma_write,
-#ifdef CONFIG_KPC_DMA_AIO
+#ifdef CONFIG_KPC2000_DMA_AIO
 	.aio_read       = kpc_dma_aio_read,
 	.aio_write      = kpc_dma_aio_write,
 #endif
-- 
2.20.1



More information about the devel mailing list