From 162e6376ac58440beb6a2d2ee294f5d88ea58dd1 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Tue, 24 Oct 2017 11:22:42 -0400 Subject: media: pci: Convert timers to use timer_setup() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: Andy Walls Cc: Sergey Kozlov Cc: Abylay Ospan Cc: Ezequiel Garcia Cc: Arvind Yadav Cc: Geliang Tang Cc: Sean Young Cc: "Pali Rohár" Signed-off-by: Kees Cook [hans.verkuil@cisco.com: dropped pci/ttpci/av7110_ir.c patch chunk] Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/pci/tw686x/tw686x-core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'drivers/media/pci/tw686x') diff --git a/drivers/media/pci/tw686x/tw686x-core.c b/drivers/media/pci/tw686x/tw686x-core.c index 336e2f9bc1b6..c74c23cf8ced 100644 --- a/drivers/media/pci/tw686x/tw686x-core.c +++ b/drivers/media/pci/tw686x/tw686x-core.c @@ -126,9 +126,9 @@ void tw686x_enable_channel(struct tw686x_dev *dev, unsigned int channel) * channels "too fast" which makes some TW686x devices very * angry and freeze the CPU (see note 1). */ -static void tw686x_dma_delay(unsigned long data) +static void tw686x_dma_delay(struct timer_list *t) { - struct tw686x_dev *dev = (struct tw686x_dev *)data; + struct tw686x_dev *dev = from_timer(dev, t, dma_delay_timer); unsigned long flags; spin_lock_irqsave(&dev->lock, flags); @@ -325,8 +325,7 @@ static int tw686x_probe(struct pci_dev *pci_dev, goto iounmap; } - setup_timer(&dev->dma_delay_timer, - tw686x_dma_delay, (unsigned long) dev); + timer_setup(&dev->dma_delay_timer, tw686x_dma_delay, 0); /* * This must be set right before initializing v4l2_dev. -- cgit