aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2008-08-14 12:37:34 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-10-17 17:41:08 -0400
commit1817b1692a2eab022e805d32e910f4556c89dce8 (patch)
treee3014e48b4bbbbbd7b0630911ea9a8ee92a2b689 /drivers
parent15d5a9acb1df1e22a7ba60aaaad758d9d71e5ea7 (diff)
USB: remove warn() macro from usb input drivers
USB should not be having it's own printk macros, so remove warn() and use the system-wide standard of dev_warn() wherever possible. In the few places that will not work out, use a basic printk(). Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/joystick/iforce/iforce-ff.c36
-rw-r--r--drivers/input/joystick/iforce/iforce-main.c14
-rw-r--r--drivers/input/joystick/iforce/iforce-packets.c8
-rw-r--r--drivers/input/joystick/iforce/iforce-usb.c2
-rw-r--r--drivers/input/misc/ati_remote.c14
-rw-r--r--drivers/input/tablet/aiptek.c13
6 files changed, 52 insertions, 35 deletions
diff --git a/drivers/input/joystick/iforce/iforce-ff.c b/drivers/input/joystick/iforce/iforce-ff.c
index 7839b7b6fa96..0de9a0943a9e 100644
--- a/drivers/input/joystick/iforce/iforce-ff.c
+++ b/drivers/input/joystick/iforce/iforce-ff.c
@@ -197,13 +197,16 @@ static unsigned char find_button(struct iforce *iforce, signed short button)
197 * Analyse the changes in an effect, and tell if we need to send an condition 197 * Analyse the changes in an effect, and tell if we need to send an condition
198 * parameter packet 198 * parameter packet
199 */ 199 */
200static int need_condition_modifier(struct ff_effect *old, struct ff_effect *new) 200static int need_condition_modifier(struct iforce *iforce,
201 struct ff_effect *old,
202 struct ff_effect *new)
201{ 203{
202 int ret = 0; 204 int ret = 0;
203 int i; 205 int i;
204 206
205 if (new->type != FF_SPRING && new->type != FF_FRICTION) { 207 if (new->type != FF_SPRING && new->type != FF_FRICTION) {
206 warn("bad effect type in need_condition_modifier"); 208 dev_warn(&iforce->dev->dev, "bad effect type in %s\n",
209 __func__);
207 return 0; 210 return 0;
208 } 211 }
209 212
@@ -222,10 +225,13 @@ static int need_condition_modifier(struct ff_effect *old, struct ff_effect *new)
222 * Analyse the changes in an effect, and tell if we need to send a magnitude 225 * Analyse the changes in an effect, and tell if we need to send a magnitude
223 * parameter packet 226 * parameter packet
224 */ 227 */
225static int need_magnitude_modifier(struct ff_effect *old, struct ff_effect *effect) 228static int need_magnitude_modifier(struct iforce *iforce,
229 struct ff_effect *old,
230 struct ff_effect *effect)
226{ 231{
227 if (effect->type != FF_CONSTANT) { 232 if (effect->type != FF_CONSTANT) {
228 warn("bad effect type in need_envelope_modifier"); 233 dev_warn(&iforce->dev->dev, "bad effect type in %s\n",
234 __func__);
229 return 0; 235 return 0;
230 } 236 }
231 237
@@ -236,7 +242,8 @@ static int need_magnitude_modifier(struct ff_effect *old, struct ff_effect *effe
236 * Analyse the changes in an effect, and tell if we need to send an envelope 242 * Analyse the changes in an effect, and tell if we need to send an envelope
237 * parameter packet 243 * parameter packet
238 */ 244 */
239static int need_envelope_modifier(struct ff_effect *old, struct ff_effect *effect) 245static int need_envelope_modifier(struct iforce *iforce, struct ff_effect *old,
246 struct ff_effect *effect)
240{ 247{
241 switch (effect->type) { 248 switch (effect->type) {
242 case FF_CONSTANT: 249 case FF_CONSTANT:
@@ -256,7 +263,8 @@ static int need_envelope_modifier(struct ff_effect *old, struct ff_effect *effec
256 break; 263 break;
257 264
258 default: 265 default:
259 warn("bad effect type in need_envelope_modifier"); 266 dev_warn(&iforce->dev->dev, "bad effect type in %s\n",
267 __func__);
260 } 268 }
261 269
262 return 0; 270 return 0;
@@ -266,10 +274,12 @@ static int need_envelope_modifier(struct ff_effect *old, struct ff_effect *effec
266 * Analyse the changes in an effect, and tell if we need to send a periodic 274 * Analyse the changes in an effect, and tell if we need to send a periodic
267 * parameter effect 275 * parameter effect
268 */ 276 */
269static int need_period_modifier(struct ff_effect *old, struct ff_effect *new) 277static int need_period_modifier(struct iforce *iforce, struct ff_effect *old,
278 struct ff_effect *new)
270{ 279{
271 if (new->type != FF_PERIODIC) { 280 if (new->type != FF_PERIODIC) {
272 warn("bad effect type in need_period_modifier"); 281 dev_warn(&iforce->dev->dev, "bad effect type in %s\n",
282 __func__);
273 return 0; 283 return 0;
274 } 284 }
275 return (old->u.periodic.period != new->u.periodic.period 285 return (old->u.periodic.period != new->u.periodic.period
@@ -355,7 +365,7 @@ int iforce_upload_periodic(struct iforce *iforce, struct ff_effect *effect, stru
355 int param2_err = 1; 365 int param2_err = 1;
356 int core_err = 0; 366 int core_err = 0;
357 367
358 if (!old || need_period_modifier(old, effect)) { 368 if (!old || need_period_modifier(iforce, old, effect)) {
359 param1_err = make_period_modifier(iforce, mod1_chunk, 369 param1_err = make_period_modifier(iforce, mod1_chunk,
360 old != NULL, 370 old != NULL,
361 effect->u.periodic.magnitude, effect->u.periodic.offset, 371 effect->u.periodic.magnitude, effect->u.periodic.offset,
@@ -365,7 +375,7 @@ int iforce_upload_periodic(struct iforce *iforce, struct ff_effect *effect, stru
365 set_bit(FF_MOD1_IS_USED, core_effect->flags); 375 set_bit(FF_MOD1_IS_USED, core_effect->flags);
366 } 376 }
367 377
368 if (!old || need_envelope_modifier(old, effect)) { 378 if (!old || need_envelope_modifier(iforce, old, effect)) {
369 param2_err = make_envelope_modifier(iforce, mod2_chunk, 379 param2_err = make_envelope_modifier(iforce, mod2_chunk,
370 old !=NULL, 380 old !=NULL,
371 effect->u.periodic.envelope.attack_length, 381 effect->u.periodic.envelope.attack_length,
@@ -425,7 +435,7 @@ int iforce_upload_constant(struct iforce *iforce, struct ff_effect *effect, stru
425 int param2_err = 1; 435 int param2_err = 1;
426 int core_err = 0; 436 int core_err = 0;
427 437
428 if (!old || need_magnitude_modifier(old, effect)) { 438 if (!old || need_magnitude_modifier(iforce, old, effect)) {
429 param1_err = make_magnitude_modifier(iforce, mod1_chunk, 439 param1_err = make_magnitude_modifier(iforce, mod1_chunk,
430 old != NULL, 440 old != NULL,
431 effect->u.constant.level); 441 effect->u.constant.level);
@@ -434,7 +444,7 @@ int iforce_upload_constant(struct iforce *iforce, struct ff_effect *effect, stru
434 set_bit(FF_MOD1_IS_USED, core_effect->flags); 444 set_bit(FF_MOD1_IS_USED, core_effect->flags);
435 } 445 }
436 446
437 if (!old || need_envelope_modifier(old, effect)) { 447 if (!old || need_envelope_modifier(iforce, old, effect)) {
438 param2_err = make_envelope_modifier(iforce, mod2_chunk, 448 param2_err = make_envelope_modifier(iforce, mod2_chunk,
439 old != NULL, 449 old != NULL,
440 effect->u.constant.envelope.attack_length, 450 effect->u.constant.envelope.attack_length,
@@ -487,7 +497,7 @@ int iforce_upload_condition(struct iforce *iforce, struct ff_effect *effect, str
487 default: return -1; 497 default: return -1;
488 } 498 }
489 499
490 if (!old || need_condition_modifier(old, effect)) { 500 if (!old || need_condition_modifier(iforce, old, effect)) {
491 param_err = make_condition_modifier(iforce, mod1_chunk, 501 param_err = make_condition_modifier(iforce, mod1_chunk,
492 old != NULL, 502 old != NULL,
493 effect->u.condition[0].right_saturation, 503 effect->u.condition[0].right_saturation,
diff --git a/drivers/input/joystick/iforce/iforce-main.c b/drivers/input/joystick/iforce/iforce-main.c
index 61ee6e38739d..baabf8302645 100644
--- a/drivers/input/joystick/iforce/iforce-main.c
+++ b/drivers/input/joystick/iforce/iforce-main.c
@@ -218,7 +218,9 @@ static void iforce_release(struct input_dev *dev)
218 /* Check: no effects should be present in memory */ 218 /* Check: no effects should be present in memory */
219 for (i = 0; i < dev->ff->max_effects; i++) { 219 for (i = 0; i < dev->ff->max_effects; i++) {
220 if (test_bit(FF_CORE_IS_USED, iforce->core_effects[i].flags)) { 220 if (test_bit(FF_CORE_IS_USED, iforce->core_effects[i].flags)) {
221 warn("iforce_release: Device still owns effects"); 221 dev_warn(&dev->dev,
222 "%s: Device still owns effects\n",
223 __func__);
222 break; 224 break;
223 } 225 }
224 } 226 }
@@ -335,26 +337,26 @@ int iforce_init_device(struct iforce *iforce)
335 if (!iforce_get_id_packet(iforce, "M")) 337 if (!iforce_get_id_packet(iforce, "M"))
336 input_dev->id.vendor = (iforce->edata[2] << 8) | iforce->edata[1]; 338 input_dev->id.vendor = (iforce->edata[2] << 8) | iforce->edata[1];
337 else 339 else
338 warn("Device does not respond to id packet M"); 340 dev_warn(&iforce->dev->dev, "Device does not respond to id packet M\n");
339 341
340 if (!iforce_get_id_packet(iforce, "P")) 342 if (!iforce_get_id_packet(iforce, "P"))
341 input_dev->id.product = (iforce->edata[2] << 8) | iforce->edata[1]; 343 input_dev->id.product = (iforce->edata[2] << 8) | iforce->edata[1];
342 else 344 else
343 warn("Device does not respond to id packet P"); 345 dev_warn(&iforce->dev->dev, "Device does not respond to id packet P\n");
344 346
345 if (!iforce_get_id_packet(iforce, "B")) 347 if (!iforce_get_id_packet(iforce, "B"))
346 iforce->device_memory.end = (iforce->edata[2] << 8) | iforce->edata[1]; 348 iforce->device_memory.end = (iforce->edata[2] << 8) | iforce->edata[1];
347 else 349 else
348 warn("Device does not respond to id packet B"); 350 dev_warn(&iforce->dev->dev, "Device does not respond to id packet B\n");
349 351
350 if (!iforce_get_id_packet(iforce, "N")) 352 if (!iforce_get_id_packet(iforce, "N"))
351 ff_effects = iforce->edata[1]; 353 ff_effects = iforce->edata[1];
352 else 354 else
353 warn("Device does not respond to id packet N"); 355 dev_warn(&iforce->dev->dev, "Device does not respond to id packet N\n");
354 356
355 /* Check if the device can store more effects than the driver can really handle */ 357 /* Check if the device can store more effects than the driver can really handle */
356 if (ff_effects > IFORCE_EFFECTS_MAX) { 358 if (ff_effects > IFORCE_EFFECTS_MAX) {
357 warn("Limiting number of effects to %d (device reports %d)", 359 dev_warn(&iforce->dev->dev, "Limiting number of effects to %d (device reports %d)\n",
358 IFORCE_EFFECTS_MAX, ff_effects); 360 IFORCE_EFFECTS_MAX, ff_effects);
359 ff_effects = IFORCE_EFFECTS_MAX; 361 ff_effects = IFORCE_EFFECTS_MAX;
360 } 362 }
diff --git a/drivers/input/joystick/iforce/iforce-packets.c b/drivers/input/joystick/iforce/iforce-packets.c
index 015b50aa76fc..a17b50016009 100644
--- a/drivers/input/joystick/iforce/iforce-packets.c
+++ b/drivers/input/joystick/iforce/iforce-packets.c
@@ -65,7 +65,8 @@ int iforce_send_packet(struct iforce *iforce, u16 cmd, unsigned char* data)
65 65
66 66
67 if (CIRC_SPACE(head, tail, XMIT_SIZE) < n+2) { 67 if (CIRC_SPACE(head, tail, XMIT_SIZE) < n+2) {
68 warn("not enough space in xmit buffer to send new packet"); 68 dev_warn(&iforce->dev->dev,
69 "not enough space in xmit buffer to send new packet\n");
69 spin_unlock_irqrestore(&iforce->xmit_lock, flags); 70 spin_unlock_irqrestore(&iforce->xmit_lock, flags);
70 return -1; 71 return -1;
71 } 72 }
@@ -148,7 +149,7 @@ static int mark_core_as_ready(struct iforce *iforce, unsigned short addr)
148 return 0; 149 return 0;
149 } 150 }
150 } 151 }
151 warn("unused effect %04x updated !!!", addr); 152 dev_warn(&iforce->dev->dev, "unused effect %04x updated !!!\n", addr);
152 return -1; 153 return -1;
153} 154}
154 155
@@ -159,7 +160,8 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data)
159 static int being_used = 0; 160 static int being_used = 0;
160 161
161 if (being_used) 162 if (being_used)
162 warn("re-entrant call to iforce_process %d", being_used); 163 dev_warn(&iforce->dev->dev,
164 "re-entrant call to iforce_process %d\n", being_used);
163 being_used++; 165 being_used++;
164 166
165#ifdef CONFIG_JOYSTICK_IFORCE_232 167#ifdef CONFIG_JOYSTICK_IFORCE_232
diff --git a/drivers/input/joystick/iforce/iforce-usb.c b/drivers/input/joystick/iforce/iforce-usb.c
index 851cc4087c2f..f83185aeb511 100644
--- a/drivers/input/joystick/iforce/iforce-usb.c
+++ b/drivers/input/joystick/iforce/iforce-usb.c
@@ -64,7 +64,7 @@ void iforce_usb_xmit(struct iforce *iforce)
64 64
65 if ( (n=usb_submit_urb(iforce->out, GFP_ATOMIC)) ) { 65 if ( (n=usb_submit_urb(iforce->out, GFP_ATOMIC)) ) {
66 clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags); 66 clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags);
67 warn("usb_submit_urb failed %d\n", n); 67 dev_warn(&iforce->dev->dev, "usb_submit_urb failed %d\n", n);
68 } 68 }
69 69
70 /* The IFORCE_XMIT_RUNNING bit is not cleared here. That's intended. 70 /* The IFORCE_XMIT_RUNNING bit is not cleared here. That's intended.
diff --git a/drivers/input/misc/ati_remote.c b/drivers/input/misc/ati_remote.c
index debfc1af9d95..428ecd3294a3 100644
--- a/drivers/input/misc/ati_remote.c
+++ b/drivers/input/misc/ati_remote.c
@@ -285,7 +285,6 @@ static const struct {
285}; 285};
286 286
287/* Local function prototypes */ 287/* Local function prototypes */
288static void ati_remote_dump (unsigned char *data, unsigned int actual_length);
289static int ati_remote_open (struct input_dev *inputdev); 288static int ati_remote_open (struct input_dev *inputdev);
290static void ati_remote_close (struct input_dev *inputdev); 289static void ati_remote_close (struct input_dev *inputdev);
291static int ati_remote_sendpacket (struct ati_remote *ati_remote, u16 cmd, unsigned char *data); 290static int ati_remote_sendpacket (struct ati_remote *ati_remote, u16 cmd, unsigned char *data);
@@ -307,15 +306,16 @@ static struct usb_driver ati_remote_driver = {
307/* 306/*
308 * ati_remote_dump_input 307 * ati_remote_dump_input
309 */ 308 */
310static void ati_remote_dump(unsigned char *data, unsigned int len) 309static void ati_remote_dump(struct device *dev, unsigned char *data,
310 unsigned int len)
311{ 311{
312 if ((len == 1) && (data[0] != (unsigned char)0xff) && (data[0] != 0x00)) 312 if ((len == 1) && (data[0] != (unsigned char)0xff) && (data[0] != 0x00))
313 warn("Weird byte 0x%02x", data[0]); 313 dev_warn(dev, "Weird byte 0x%02x\n", data[0]);
314 else if (len == 4) 314 else if (len == 4)
315 warn("Weird key %02x %02x %02x %02x", 315 dev_warn(dev, "Weird key %02x %02x %02x %02x\n",
316 data[0], data[1], data[2], data[3]); 316 data[0], data[1], data[2], data[3]);
317 else 317 else
318 warn("Weird data, len=%d %02x %02x %02x %02x %02x %02x ...", 318 dev_warn(dev, "Weird data, len=%d %02x %02x %02x %02x %02x %02x ...\n",
319 len, data[0], data[1], data[2], data[3], data[4], data[5]); 319 len, data[0], data[1], data[2], data[3], data[4], data[5]);
320} 320}
321 321
@@ -470,7 +470,7 @@ static void ati_remote_input_report(struct urb *urb)
470 /* Deal with strange looking inputs */ 470 /* Deal with strange looking inputs */
471 if ( (urb->actual_length != 4) || (data[0] != 0x14) || 471 if ( (urb->actual_length != 4) || (data[0] != 0x14) ||
472 ((data[3] & 0x0f) != 0x00) ) { 472 ((data[3] & 0x0f) != 0x00) ) {
473 ati_remote_dump(data, urb->actual_length); 473 ati_remote_dump(&urb->dev->dev, data, urb->actual_length);
474 return; 474 return;
475 } 475 }
476 476
@@ -814,7 +814,7 @@ static void ati_remote_disconnect(struct usb_interface *interface)
814 ati_remote = usb_get_intfdata(interface); 814 ati_remote = usb_get_intfdata(interface);
815 usb_set_intfdata(interface, NULL); 815 usb_set_intfdata(interface, NULL);
816 if (!ati_remote) { 816 if (!ati_remote) {
817 warn("%s - null device?\n", __func__); 817 dev_warn(&interface->dev, "%s - null device?\n", __func__);
818 return; 818 return;
819 } 819 }
820 820
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c
index e53c838f1866..1aa82e8af614 100644
--- a/drivers/input/tablet/aiptek.c
+++ b/drivers/input/tablet/aiptek.c
@@ -1706,20 +1706,21 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
1706 aiptek = kzalloc(sizeof(struct aiptek), GFP_KERNEL); 1706 aiptek = kzalloc(sizeof(struct aiptek), GFP_KERNEL);
1707 inputdev = input_allocate_device(); 1707 inputdev = input_allocate_device();
1708 if (!aiptek || !inputdev) { 1708 if (!aiptek || !inputdev) {
1709 warn("aiptek: cannot allocate memory or input device"); 1709 dev_warn(&intf->dev,
1710 "cannot allocate memory or input device\n");
1710 goto fail1; 1711 goto fail1;
1711 } 1712 }
1712 1713
1713 aiptek->data = usb_buffer_alloc(usbdev, AIPTEK_PACKET_LENGTH, 1714 aiptek->data = usb_buffer_alloc(usbdev, AIPTEK_PACKET_LENGTH,
1714 GFP_ATOMIC, &aiptek->data_dma); 1715 GFP_ATOMIC, &aiptek->data_dma);
1715 if (!aiptek->data) { 1716 if (!aiptek->data) {
1716 warn("aiptek: cannot allocate usb buffer"); 1717 dev_warn(&intf->dev, "cannot allocate usb buffer\n");
1717 goto fail1; 1718 goto fail1;
1718 } 1719 }
1719 1720
1720 aiptek->urb = usb_alloc_urb(0, GFP_KERNEL); 1721 aiptek->urb = usb_alloc_urb(0, GFP_KERNEL);
1721 if (!aiptek->urb) { 1722 if (!aiptek->urb) {
1722 warn("aiptek: cannot allocate urb"); 1723 dev_warn(&intf->dev, "cannot allocate urb\n");
1723 goto fail2; 1724 goto fail2;
1724 } 1725 }
1725 1726
@@ -1864,7 +1865,8 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
1864 */ 1865 */
1865 err = sysfs_create_group(&intf->dev.kobj, &aiptek_attribute_group); 1866 err = sysfs_create_group(&intf->dev.kobj, &aiptek_attribute_group);
1866 if (err) { 1867 if (err) {
1867 warn("aiptek: cannot create sysfs group err: %d", err); 1868 dev_warn(&intf->dev, "cannot create sysfs group err: %d\n",
1869 err);
1868 goto fail3; 1870 goto fail3;
1869 } 1871 }
1870 1872
@@ -1872,7 +1874,8 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
1872 */ 1874 */
1873 err = input_register_device(aiptek->inputdev); 1875 err = input_register_device(aiptek->inputdev);
1874 if (err) { 1876 if (err) {
1875 warn("aiptek: input_register_device returned err: %d", err); 1877 dev_warn(&intf->dev,
1878 "input_register_device returned err: %d\n", err);
1876 goto fail4; 1879 goto fail4;
1877 } 1880 }
1878 return 0; 1881 return 0;