Skip to content

Commit

Permalink
tests: dma: use generic callback arg for all dma_callbacks
Browse files Browse the repository at this point in the history
Replace the first argument in dma_callback with
generic 'void * arg'.

Signed-off-by: Jun Li <jun.r.li@intel.com>
  • Loading branch information
jli157 authored and nashif committed Oct 16, 2018
1 parent 4982fa9 commit 2acbaf4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/boards/altera_max10/msgdma/src/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static char rx_data[DMA_BUFF_SIZE];
static struct dma_config dma_cfg = {0};
static struct dma_block_config dma_block_cfg = {0};

static void dma_user_callback(struct device *dev, u32_t id, int error_code)
static void dma_user_callback(void *arg, u32_t id, int error_code)
{
if (error_code == 0) {
TC_PRINT("DMA completed successfully\n");
Expand Down
2 changes: 1 addition & 1 deletion tests/boards/intel_s1000_crb/src/dma_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static char rx_data2[RX_BUFF_SIZE] = { 0 };
static char rx_data3[RX_BUFF_SIZE] = { 0 };
static char rx_data4[RX_BUFF_SIZE] = { 0 };

static void test_done(struct device *dev, u32_t id, int error_code)
static void test_done(void *arg, u32_t id, int error_code)
{
if (error_code == 0) {
printk("DMA transfer done\n");
Expand Down
2 changes: 1 addition & 1 deletion tests/drivers/dma/chan_blen_transfer/src/test_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
static const char tx_data[] = "It is harder to be kind than to be wise";
static char rx_data[RX_BUFF_SIZE] = { 0 };

static void test_done(struct device *dev, u32_t id, int error_code)
static void test_done(void *arg, u32_t id, int error_code)
{
if (error_code == 0) {
TC_PRINT("DMA transfer done\n");
Expand Down
5 changes: 4 additions & 1 deletion tests/drivers/dma/loop_transfer/src/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ static void test_error(void)
printk("DMA could not proceed, an error occurred\n");
}

static void dma_user_callback(struct device *dev, u32_t id, int error_code)
static void dma_user_callback(void *arg, u32_t id, int error_code)
{
struct device *dev = (struct device *)arg;

if (error_code == 0) {
test_transfer(dev, id);
} else {
Expand Down Expand Up @@ -79,6 +81,7 @@ void main(void)
dma_cfg.dest_data_size = 1;
dma_cfg.source_burst_length = 1;
dma_cfg.dest_burst_length = 1;
dma_cfg.callback_arg = dma;
dma_cfg.dma_callback = dma_user_callback;
dma_cfg.block_count = 1;
dma_cfg.head_block = &dma_block_cfg;
Expand Down

0 comments on commit 2acbaf4

Please sign in to comment.