diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-03-23 02:57:40 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-25 22:44:44 +0400 |
commit | c5cf4606b6659e711258b6e567415ab83a3b646c (patch) | |
tree | c775b0ce877038e72bdd1c71d4e7491b9a422426 | |
parent | ddd9813e75c54cd41d561af8f35aa023839155b1 (diff) | |
download | linux-c5cf4606b6659e711258b6e567415ab83a3b646c.tar.xz |
staging: comedi: s626: remove MC_DISABLE macro
This macro relies on a local variable having a specific name. Replace
it with a new helper function, s626_mc_disable().
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/comedi/drivers/s626.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index a6450ffb7efe..138a943c57e5 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -150,7 +150,13 @@ static void s626_mc_enable(struct comedi_device *dev, writel(val, devpriv->base_addr + reg); } -#define MC_DISABLE(REGADRS, CTRLWORD) writel((uint32_t)(CTRLWORD) << 16 , devpriv->base_addr+(REGADRS)) +static void s626_mc_disable(struct comedi_device *dev, + unsigned int cmd, unsigned int reg) +{ + struct s626_private *devpriv = dev->private; + + writel(cmd << 16 , devpriv->base_addr + reg); +} #define MC_TEST(REGADRS, CTRLWORD) ((readl(devpriv->base_addr+(REGADRS)) & CTRLWORD) != 0) @@ -851,8 +857,8 @@ static bool handle_eos_interrupt(struct comedi_device *dev) if (devpriv->ai_sample_count <= 0) { devpriv->ai_cmd_running = 0; - /* Stop RPS program. */ - MC_DISABLE(P_MC1, MC1_ERPS1); + /* Stop RPS program */ + s626_mc_disable(dev, MC1_ERPS1, P_MC1); /* send end of acquisition */ async->events |= COMEDI_CB_EOA; @@ -926,8 +932,8 @@ static void ResetADC(struct comedi_device *dev, uint8_t *ppl) uint32_t LocalPPL; struct comedi_cmd *cmd = &(dev->subdevices->async->cmd); - /* Stop RPS program in case it is currently running. */ - MC_DISABLE(P_MC1, MC1_ERPS1); + /* Stop RPS program in case it is currently running */ + s626_mc_disable(dev, MC1_ERPS1, P_MC1); /* Set starting logical address to write RPS commands. */ pRPS = (uint32_t *) devpriv->RPSBuf.LogicalBase; @@ -1574,8 +1580,8 @@ static int s626_ai_cancel(struct comedi_device *dev, struct comedi_subdevice *s) { struct s626_private *devpriv = dev->private; - /* Stop RPS program in case it is currently running. */ - MC_DISABLE(P_MC1, MC1_ERPS1); + /* Stop RPS program in case it is currently running */ + s626_mc_disable(dev, MC1_ERPS1, P_MC1); /* disable master interrupt */ writel(0, devpriv->base_addr + P_IER); |