This patch introduces the use of function setup_timer.
This is done using Coccinelle and semantic patch used is
as follows:
@@
expression x,y,z;
@@
- init_timer (&x);
+ setup_timer (&x, y, z);
- x.function = y;
- x.data = z;
Signed-off-by: Vaishali Thakkar <[email protected]>
---
drivers/staging/comedi/drivers/comedi_test.c | 5 ++---
drivers/staging/comedi/drivers/das16.c | 5 ++---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/comedi/drivers/comedi_test.c b/drivers/staging/comedi/drivers/comedi_test.c
index e56525a..fbc4342 100644
--- a/drivers/staging/comedi/drivers/comedi_test.c
+++ b/drivers/staging/comedi/drivers/comedi_test.c
@@ -420,9 +420,8 @@ static int waveform_attach(struct comedi_device *dev,
for (i = 0; i < s->n_chan; i++)
devpriv->ao_loopbacks[i] = s->maxdata / 2;
- init_timer(&devpriv->timer);
- devpriv->timer.function = waveform_ai_interrupt;
- devpriv->timer.data = (unsigned long)dev;
+ setup_timer(&devpriv->timer, waveform_ai_interrupt,
+ (unsigned long)dev);
dev_info(dev->class_dev,
"%s: %i microvolt, %li microsecond waveform attached\n",
diff --git a/drivers/staging/comedi/drivers/das16.c b/drivers/staging/comedi/drivers/das16.c
index 466d4ef..f971140 100644
--- a/drivers/staging/comedi/drivers/das16.c
+++ b/drivers/staging/comedi/drivers/das16.c
@@ -954,9 +954,8 @@ static void das16_alloc_dma(struct comedi_device *dev, unsigned int dma_chan)
devpriv->dma = comedi_isadma_alloc(dev, 2, dma_chan, dma_chan,
DAS16_DMA_SIZE, COMEDI_ISADMA_READ);
if (devpriv->dma) {
- init_timer(&devpriv->timer);
- devpriv->timer.function = das16_timer_interrupt;
- devpriv->timer.data = (unsigned long)dev;
+ setup_timer(&devpriv->timer, das16_timer_interrupt,
+ (unsigned long)dev);
}
}
--
1.9.1
On Sun, Feb 08, 2015 at 12:25:53PM +0530, Vaishali Thakkar wrote:
> This patch introduces the use of function setup_timer.
>
> This is done using Coccinelle and semantic patch used is
> as follows:
>
> @@
> expression x,y,z;
> @@
>
> - init_timer (&x);
> + setup_timer (&x, y, z);
> - x.function = y;
> - x.data = z;
>
> Signed-off-by: Vaishali Thakkar <[email protected]>
> ---
> drivers/staging/comedi/drivers/comedi_test.c | 5 ++---
> drivers/staging/comedi/drivers/das16.c | 5 ++---
> 2 files changed, 4 insertions(+), 6 deletions(-)
Sorry, someone else already sent me this patch before you did :(