WorkStruct: make allyesconfig
[deliverable/linux.git] / drivers / media / dvb / dvb-usb / dvb-usb-remote.c
index e5c6d9835e06d24cac72b3ae3f342cab98b055da..794e4471561c3fd7e365769bf242701237ff0059 100644 (file)
@@ -1,20 +1,22 @@
 /* dvb-usb-remote.c is part of the DVB USB library.
  *
- * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de)
+ * Copyright (C) 2004-6 Patrick Boettcher (patrick.boettcher@desy.de)
  * see dvb-usb-init.c for copyright information.
  *
  * This file contains functions for initializing the the input-device and for handling remote-control-queries.
  */
 #include "dvb-usb-common.h"
+#include <linux/usb/input.h>
 
 /* Remote-control poll function - called every dib->rc_query_interval ms to see
  * whether the remote control has received anything.
  *
  * TODO: Fix the repeat rate of the input device.
  */
-static void dvb_usb_read_remote_control(void *data)
+static void dvb_usb_read_remote_control(struct work_struct *work)
 {
-       struct dvb_usb_device *d = data;
+       struct dvb_usb_device *d =
+               container_of(work, struct dvb_usb_device, rc_query_work.work);
        u32 event;
        int state;
 
@@ -96,7 +98,7 @@ int dvb_usb_remote_init(struct dvb_usb_device *d)
                return 0;
 
        usb_make_path(d->udev, d->rc_phys, sizeof(d->rc_phys));
-       strlcpy(d->rc_phys, "/ir0", sizeof(d->rc_phys));
+       strlcat(d->rc_phys, "/ir0", sizeof(d->rc_phys));
 
        d->rc_input_dev = input_allocate_device();
        if (!d->rc_input_dev)
@@ -107,6 +109,8 @@ int dvb_usb_remote_init(struct dvb_usb_device *d)
        d->rc_input_dev->keycodemax = KEY_MAX;
        d->rc_input_dev->name = "IR-receiver inside an USB DVB receiver";
        d->rc_input_dev->phys = d->rc_phys;
+       usb_to_input_id(d->udev, &d->rc_input_dev->id);
+       d->rc_input_dev->cdev.dev = &d->udev->dev;
 
        /* set the bits for the keys */
        deb_rc("key map size: %d\n", d->props.rc_key_map_size);
@@ -125,7 +129,7 @@ int dvb_usb_remote_init(struct dvb_usb_device *d)
 
        input_register_device(d->rc_input_dev);
 
-       INIT_WORK(&d->rc_query_work, dvb_usb_read_remote_control, d);
+       INIT_DELAYED_WORK(&d->rc_query_work, dvb_usb_read_remote_control);
 
        info("schedule remote query interval to %d msecs.", d->props.rc_interval);
        schedule_delayed_work(&d->rc_query_work,msecs_to_jiffies(d->props.rc_interval));
This page took 0.024244 seconds and 5 git commands to generate.