aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/input/keyspan_remote.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-04 18:13:17 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-04 18:16:12 -0700
commita3d52136ee8f7399859f9a0824470fd49b1d1a00 (patch)
treeac0fd3d1efc356029cbbc5e413f778f7231cd909 /drivers/usb/input/keyspan_remote.c
parent5b339915762d30b21995aa7263e74081f2f1110a (diff)
parent84767d00a8fd54dd97866561f6e2ee246c8e1cdc (diff)
Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/dtor/input: (65 commits) Input: gpio_keys - add support for switches (EV_SW) Input: cobalt_btns - convert to use polldev library Input: add skeleton for simple polled devices Input: update some documentation Input: wistron - fix typo in keymap for Acer TM610 Input: add input_set_capability() helper Input: i8042 - add Fujitsu touchscreen/touchpad PNP IDs Input: i8042 - add Panasonic CF-29 to nomux list Input: lifebook - split into 2 devices Input: lifebook - add signature of Panasonic CF-29 Input: lifebook - activate 6-byte protocol on select models Input: lifebook - work properly on Panasonic CF-18 Input: cobalt buttons - separate device and driver registration Input: ati_remote - make button repeat sensitivity configurable Input: pxa27x - do not use deprecated SA_INTERRUPT flag Input: ucb1400 - make delays configurable Input: misc devices - switch to using input_dev->dev.parent Input: joysticks - switch to using input_dev->dev.parent Input: touchscreens - switch to using input_dev->dev.parent Input: mice - switch to using input_dev->dev.parent ... Fixed up conflicts with core device model removal of "struct subsystem" manually. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/usb/input/keyspan_remote.c')
-rw-r--r--drivers/usb/input/keyspan_remote.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/usb/input/keyspan_remote.c b/drivers/usb/input/keyspan_remote.c
index 98bd323369c..1bffc9fa98c 100644
--- a/drivers/usb/input/keyspan_remote.c
+++ b/drivers/usb/input/keyspan_remote.c
@@ -394,7 +394,7 @@ resubmit:
static int keyspan_open(struct input_dev *dev)
{
- struct usb_keyspan *remote = dev->private;
+ struct usb_keyspan *remote = input_get_drvdata(dev);
remote->irq_urb->dev = remote->udev;
if (usb_submit_urb(remote->irq_urb, GFP_KERNEL))
@@ -405,7 +405,7 @@ static int keyspan_open(struct input_dev *dev)
static void keyspan_close(struct input_dev *dev)
{
- struct usb_keyspan *remote = dev->private;
+ struct usb_keyspan *remote = input_get_drvdata(dev);
usb_kill_urb(remote->irq_urb);
}
@@ -437,7 +437,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic
struct usb_endpoint_descriptor *endpoint;
struct usb_keyspan *remote;
struct input_dev *input_dev;
- int i, retval;
+ int i, error;
endpoint = keyspan_get_in_endpoint(interface->cur_altsetting);
if (!endpoint)
@@ -446,7 +446,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic
remote = kzalloc(sizeof(*remote), GFP_KERNEL);
input_dev = input_allocate_device();
if (!remote || !input_dev) {
- retval = -ENOMEM;
+ error = -ENOMEM;
goto fail1;
}
@@ -458,19 +458,19 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic
remote->in_buffer = usb_buffer_alloc(udev, RECV_SIZE, GFP_ATOMIC, &remote->in_dma);
if (!remote->in_buffer) {
- retval = -ENOMEM;
+ error = -ENOMEM;
goto fail1;
}
remote->irq_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!remote->irq_urb) {
- retval = -ENOMEM;
+ error = -ENOMEM;
goto fail2;
}
- retval = keyspan_setup(udev);
- if (retval) {
- retval = -ENODEV;
+ error = keyspan_setup(udev);
+ if (error) {
+ error = -ENODEV;
goto fail3;
}
@@ -495,14 +495,15 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic
input_dev->name = remote->name;
input_dev->phys = remote->phys;
usb_to_input_id(udev, &input_dev->id);
- input_dev->cdev.dev = &interface->dev;
+ input_dev->dev.parent = &interface->dev;
input_dev->evbit[0] = BIT(EV_KEY); /* We will only report KEY events. */
for (i = 0; i < ARRAY_SIZE(keyspan_key_table); i++)
if (keyspan_key_table[i] != KEY_RESERVED)
set_bit(keyspan_key_table[i], input_dev->keybit);
- input_dev->private = remote;
+ input_set_drvdata(input_dev, remote);
+
input_dev->open = keyspan_open;
input_dev->close = keyspan_close;
@@ -517,7 +518,9 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic
remote->irq_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
/* we can register the device now, as it is ready */
- input_register_device(remote->input);
+ error = input_register_device(remote->input);
+ if (error)
+ goto fail3;
/* save our data pointer in this interface device */
usb_set_intfdata(interface, remote);
@@ -529,7 +532,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic
fail1: kfree(remote);
input_free_device(input_dev);
- return retval;
+ return error;
}
/*