diff options
author | Alan Cox <alan@linux.intel.com> | 2009-08-06 20:45:35 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-15 12:02:12 -0700 |
commit | 794f1d789520d423ef6d90d5390edea5c1b687c2 (patch) | |
tree | c6c600391d9880bf5b110b6f3dc352b8cf7beb96 /drivers/staging/sep | |
parent | 79de99e864fb731392bec78f251ce0310fed5d9a (diff) | |
download | linux-794f1d789520d423ef6d90d5390edea5c1b687c2.tar.bz2 |
Staging: sep: We have two different repeats of the same logic
So how about a little helper
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/sep')
-rw-r--r-- | drivers/staging/sep/sep_main_mod.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/staging/sep/sep_main_mod.c b/drivers/staging/sep/sep_main_mod.c index 7e2fd3d1fbe2..b739f7d46291 100644 --- a/drivers/staging/sep/sep_main_mod.c +++ b/drivers/staging/sep/sep_main_mod.c @@ -3803,6 +3803,15 @@ static int sep_set_time(unsigned long *address_ptr, return 0; } +static void sep_wait_busy(struct sep_device *dev) +{ + u32 reg; + + do { + reg = sep_read_reg(sep_dev, HW_HOST_SEP_BUSY_REG_ADDR); + } while (reg); +} + /* PATCH for configuring the DMA to single burst instead of multi-burst */ @@ -3822,9 +3831,7 @@ static void sep_configure_dma_burst(void) DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, "SEP Driver:<-------- sep_configure_dma_burst finished request access to registers from SEP (write reg) \n"); - regVal = sep_read_reg(sep_dev, HW_HOST_SEP_BUSY_REG_ADDR); - while (regVal) - regVal = sep_read_reg(sep_dev, HW_HOST_SEP_BUSY_REG_ADDR); + sep_wait_busy(sep_dev); DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, "SEP Driver:<-------- sep_configure_dma_burst finished request access to registers from SEP (while(revVal) wait loop) \n"); @@ -3834,9 +3841,7 @@ static void sep_configure_dma_burst(void) /* release the sep busy */ sep_write_reg(sep_dev, HW_HOST_HOST_SEP_GPR0_REG_ADDR, 0x0UL); - regVal = sep_read_reg(sep_dev, HW_HOST_SEP_BUSY_REG_ADDR); - while (regVal != 0x0) - regVal = sep_read_reg(sep_dev, HW_HOST_SEP_BUSY_REG_ADDR); + sep_wait_busy(sep_dev); DEBUG_PRINT_0(SEP_DEBUG_LEVEL_BASIC, "SEP Driver:<-------- sep_configure_dma_burst done \n"); |