[media] media: radio-cadet, initialize timer with setup_timer
authorMatej Hulín <mito.hulin@gmail.com>
Mon, 23 Jan 2017 09:12:30 +0000 (07:12 -0200)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 3 Feb 2017 13:23:51 +0000 (11:23 -0200)
Stop accessing timer struct members directly and use the setup_timer
helper intended for that use. It makes the code cleaner and will allow
for easier change of the timer struct internals.

Signed-off-by: Matej Hulín <mito.hulin@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/radio/radio-cadet.c

index 82affaedf06778ad73d0d40fa1a87b0e621630cd..cbaf850f47912792c75e8b9fed8de4b9258816ba 100644 (file)
@@ -309,9 +309,7 @@ static void cadet_handler(unsigned long data)
        /*
         * Clean up and exit
         */
-       init_timer(&dev->readtimer);
-       dev->readtimer.function = cadet_handler;
-       dev->readtimer.data = data;
+       setup_timer(&dev->readtimer, cadet_handler, data);
        dev->readtimer.expires = jiffies + msecs_to_jiffies(50);
        add_timer(&dev->readtimer);
 }
@@ -320,9 +318,7 @@ static void cadet_start_rds(struct cadet *dev)
 {
        dev->rdsstat = 1;
        outb(0x80, dev->io);        /* Select RDS fifo */
-       init_timer(&dev->readtimer);
-       dev->readtimer.function = cadet_handler;
-       dev->readtimer.data = (unsigned long)dev;
+       setup_timer(&dev->readtimer, cadet_handler, (unsigned long)dev);
        dev->readtimer.expires = jiffies + msecs_to_jiffies(50);
        add_timer(&dev->readtimer);
 }