diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-04 21:13:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-04 21:16:12 -0400 |
commit | a3d52136ee8f7399859f9a0824470fd49b1d1a00 (patch) | |
tree | ac0fd3d1efc356029cbbc5e413f778f7231cd909 /drivers/usb/input/acecad.c | |
parent | 5b339915762d30b21995aa7263e74081f2f1110a (diff) | |
parent | 84767d00a8fd54dd97866561f6e2ee246c8e1cdc (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/acecad.c')
-rw-r--r-- | drivers/usb/input/acecad.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/drivers/usb/input/acecad.c b/drivers/usb/input/acecad.c index 909138e5aa04..be8e9243c062 100644 --- a/drivers/usb/input/acecad.c +++ b/drivers/usb/input/acecad.c | |||
@@ -111,7 +111,7 @@ resubmit: | |||
111 | 111 | ||
112 | static int usb_acecad_open(struct input_dev *dev) | 112 | static int usb_acecad_open(struct input_dev *dev) |
113 | { | 113 | { |
114 | struct usb_acecad *acecad = dev->private; | 114 | struct usb_acecad *acecad = input_get_drvdata(dev); |
115 | 115 | ||
116 | acecad->irq->dev = acecad->usbdev; | 116 | acecad->irq->dev = acecad->usbdev; |
117 | if (usb_submit_urb(acecad->irq, GFP_KERNEL)) | 117 | if (usb_submit_urb(acecad->irq, GFP_KERNEL)) |
@@ -122,7 +122,7 @@ static int usb_acecad_open(struct input_dev *dev) | |||
122 | 122 | ||
123 | static void usb_acecad_close(struct input_dev *dev) | 123 | static void usb_acecad_close(struct input_dev *dev) |
124 | { | 124 | { |
125 | struct usb_acecad *acecad = dev->private; | 125 | struct usb_acecad *acecad = input_get_drvdata(dev); |
126 | 126 | ||
127 | usb_kill_urb(acecad->irq); | 127 | usb_kill_urb(acecad->irq); |
128 | } | 128 | } |
@@ -135,6 +135,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_ | |||
135 | struct usb_acecad *acecad; | 135 | struct usb_acecad *acecad; |
136 | struct input_dev *input_dev; | 136 | struct input_dev *input_dev; |
137 | int pipe, maxp; | 137 | int pipe, maxp; |
138 | int err = -ENOMEM; | ||
138 | 139 | ||
139 | if (interface->desc.bNumEndpoints != 1) | 140 | if (interface->desc.bNumEndpoints != 1) |
140 | return -ENODEV; | 141 | return -ENODEV; |
@@ -149,16 +150,22 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_ | |||
149 | 150 | ||
150 | acecad = kzalloc(sizeof(struct usb_acecad), GFP_KERNEL); | 151 | acecad = kzalloc(sizeof(struct usb_acecad), GFP_KERNEL); |
151 | input_dev = input_allocate_device(); | 152 | input_dev = input_allocate_device(); |
152 | if (!acecad || !input_dev) | 153 | if (!acecad || !input_dev) { |
154 | err = -ENOMEM; | ||
153 | goto fail1; | 155 | goto fail1; |
156 | } | ||
154 | 157 | ||
155 | acecad->data = usb_buffer_alloc(dev, 8, GFP_KERNEL, &acecad->data_dma); | 158 | acecad->data = usb_buffer_alloc(dev, 8, GFP_KERNEL, &acecad->data_dma); |
156 | if (!acecad->data) | 159 | if (!acecad->data) { |
160 | err= -ENOMEM; | ||
157 | goto fail1; | 161 | goto fail1; |
162 | } | ||
158 | 163 | ||
159 | acecad->irq = usb_alloc_urb(0, GFP_KERNEL); | 164 | acecad->irq = usb_alloc_urb(0, GFP_KERNEL); |
160 | if (!acecad->irq) | 165 | if (!acecad->irq) { |
166 | err = -ENOMEM; | ||
161 | goto fail2; | 167 | goto fail2; |
168 | } | ||
162 | 169 | ||
163 | acecad->usbdev = dev; | 170 | acecad->usbdev = dev; |
164 | acecad->input = input_dev; | 171 | acecad->input = input_dev; |
@@ -178,8 +185,9 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_ | |||
178 | input_dev->name = acecad->name; | 185 | input_dev->name = acecad->name; |
179 | input_dev->phys = acecad->phys; | 186 | input_dev->phys = acecad->phys; |
180 | usb_to_input_id(dev, &input_dev->id); | 187 | usb_to_input_id(dev, &input_dev->id); |
181 | input_dev->cdev.dev = &intf->dev; | 188 | input_dev->dev.parent = &intf->dev; |
182 | input_dev->private = acecad; | 189 | |
190 | input_set_drvdata(input_dev, acecad); | ||
183 | 191 | ||
184 | input_dev->open = usb_acecad_open; | 192 | input_dev->open = usb_acecad_open; |
185 | input_dev->close = usb_acecad_close; | 193 | input_dev->close = usb_acecad_close; |
@@ -221,7 +229,9 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_ | |||
221 | acecad->irq->transfer_dma = acecad->data_dma; | 229 | acecad->irq->transfer_dma = acecad->data_dma; |
222 | acecad->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; | 230 | acecad->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; |
223 | 231 | ||
224 | input_register_device(acecad->input); | 232 | err = input_register_device(acecad->input); |
233 | if (err) | ||
234 | goto fail2; | ||
225 | 235 | ||
226 | usb_set_intfdata(intf, acecad); | 236 | usb_set_intfdata(intf, acecad); |
227 | 237 | ||
@@ -230,7 +240,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_ | |||
230 | fail2: usb_buffer_free(dev, 8, acecad->data, acecad->data_dma); | 240 | fail2: usb_buffer_free(dev, 8, acecad->data, acecad->data_dma); |
231 | fail1: input_free_device(input_dev); | 241 | fail1: input_free_device(input_dev); |
232 | kfree(acecad); | 242 | kfree(acecad); |
233 | return -ENOMEM; | 243 | return err; |
234 | } | 244 | } |
235 | 245 | ||
236 | static void usb_acecad_disconnect(struct usb_interface *intf) | 246 | static void usb_acecad_disconnect(struct usb_interface *intf) |