hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/parport/ieee1284_ops.c
....@@ -27,12 +27,6 @@
2727 #undef DEBUG /* Don't want a garbled console */
2828 #endif
2929
30
-#ifdef DEBUG
31
-#define DPRINTK(stuff...) printk (stuff)
32
-#else
33
-#define DPRINTK(stuff...)
34
-#endif
35
-
3630 /*** *
3731 * One-way data transfer functions. *
3832 * ***/
....@@ -115,7 +109,7 @@
115109 if (signal_pending (current))
116110 break;
117111
118
- DPRINTK (KERN_DEBUG "%s: Timed out\n", port->name);
112
+ pr_debug("%s: Timed out\n", port->name);
119113 break;
120114
121115 ready:
....@@ -178,9 +172,8 @@
178172 if (parport_wait_peripheral (port,
179173 PARPORT_STATUS_ACK, 0)) {
180174 /* Timeout -- no more data? */
181
- DPRINTK (KERN_DEBUG
182
- "%s: Nibble timeout at event 9 (%d bytes)\n",
183
- port->name, i/2);
175
+ pr_debug("%s: Nibble timeout at event 9 (%d bytes)\n",
176
+ port->name, i / 2);
184177 parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0);
185178 break;
186179 }
....@@ -201,8 +194,7 @@
201194 PARPORT_STATUS_ACK,
202195 PARPORT_STATUS_ACK)) {
203196 /* Timeout -- no more data? */
204
- DPRINTK (KERN_DEBUG
205
- "%s: Nibble timeout at event 11\n",
197
+ pr_debug("%s: Nibble timeout at event 11\n",
206198 port->name);
207199 break;
208200 }
....@@ -219,9 +211,8 @@
219211 /* Read the last nibble without checking data avail. */
220212 if (parport_read_status (port) & PARPORT_STATUS_ERROR) {
221213 end_of_data:
222
- DPRINTK (KERN_DEBUG
223
- "%s: No more nibble data (%d bytes)\n",
224
- port->name, i/2);
214
+ pr_debug("%s: No more nibble data (%d bytes)\n",
215
+ port->name, i / 2);
225216
226217 /* Go to reverse idle phase. */
227218 parport_frob_control (port,
....@@ -272,8 +263,7 @@
272263 /* Timeout -- no more data? */
273264 parport_frob_control (port, PARPORT_CONTROL_AUTOFD,
274265 0);
275
- DPRINTK (KERN_DEBUG "%s: Byte timeout at event 9\n",
276
- port->name);
266
+ pr_debug("%s: Byte timeout at event 9\n", port->name);
277267 break;
278268 }
279269
....@@ -288,8 +278,7 @@
288278 PARPORT_STATUS_ACK,
289279 PARPORT_STATUS_ACK)) {
290280 /* Timeout -- no more data? */
291
- DPRINTK (KERN_DEBUG "%s: Byte timeout at event 11\n",
292
- port->name);
281
+ pr_debug("%s: Byte timeout at event 11\n", port->name);
293282 break;
294283 }
295284
....@@ -307,8 +296,7 @@
307296 /* Read the last byte without checking data avail. */
308297 if (parport_read_status (port) & PARPORT_STATUS_ERROR) {
309298 end_of_data:
310
- DPRINTK (KERN_DEBUG
311
- "%s: No more byte data (%zd bytes)\n",
299
+ pr_debug("%s: No more byte data (%zd bytes)\n",
312300 port->name, count);
313301
314302 /* Go to reverse idle phase. */
....@@ -353,12 +341,10 @@
353341 PARPORT_STATUS_PAPEROUT, 0);
354342
355343 if (!retval) {
356
- DPRINTK (KERN_DEBUG "%s: ECP direction: reverse\n",
357
- port->name);
344
+ pr_debug("%s: ECP direction: reverse\n", port->name);
358345 port->ieee1284.phase = IEEE1284_PH_REV_IDLE;
359346 } else {
360
- DPRINTK (KERN_DEBUG "%s: ECP direction: failed to reverse\n",
361
- port->name);
347
+ pr_debug("%s: ECP direction: failed to reverse\n", port->name);
362348 port->ieee1284.phase = IEEE1284_PH_ECP_DIR_UNKNOWN;
363349 }
364350
....@@ -384,12 +370,10 @@
384370
385371 if (!retval) {
386372 parport_data_forward (port);
387
- DPRINTK (KERN_DEBUG "%s: ECP direction: forward\n",
388
- port->name);
373
+ pr_debug("%s: ECP direction: forward\n", port->name);
389374 port->ieee1284.phase = IEEE1284_PH_FWD_IDLE;
390375 } else {
391
- DPRINTK (KERN_DEBUG
392
- "%s: ECP direction: failed to switch forward\n",
376
+ pr_debug("%s: ECP direction: failed to switch forward\n",
393377 port->name);
394378 port->ieee1284.phase = IEEE1284_PH_ECP_DIR_UNKNOWN;
395379 }
....@@ -450,7 +434,7 @@
450434 }
451435
452436 /* Time for Host Transfer Recovery (page 41 of IEEE1284) */
453
- DPRINTK (KERN_DEBUG "%s: ECP transfer stalled!\n", port->name);
437
+ pr_debug("%s: ECP transfer stalled!\n", port->name);
454438
455439 parport_frob_control (port, PARPORT_CONTROL_INIT,
456440 PARPORT_CONTROL_INIT);
....@@ -466,8 +450,7 @@
466450 if (!(parport_read_status (port) & PARPORT_STATUS_PAPEROUT))
467451 break;
468452
469
- DPRINTK (KERN_DEBUG "%s: Host transfer recovered\n",
470
- port->name);
453
+ pr_debug("%s: Host transfer recovered\n", port->name);
471454
472455 if (time_after_eq (jiffies, expire)) break;
473456 goto try_again;
....@@ -565,23 +548,20 @@
565548 command or a normal data byte, don't accept it. */
566549 if (command) {
567550 if (byte & 0x80) {
568
- DPRINTK (KERN_DEBUG "%s: stopping short at "
569
- "channel command (%02x)\n",
551
+ pr_debug("%s: stopping short at channel command (%02x)\n",
570552 port->name, byte);
571553 goto out;
572554 }
573555 else if (port->ieee1284.mode != IEEE1284_MODE_ECPRLE)
574
- DPRINTK (KERN_DEBUG "%s: device illegally "
575
- "using RLE; accepting anyway\n",
556
+ pr_debug("%s: device illegally using RLE; accepting anyway\n",
576557 port->name);
577558
578559 rle_count = byte + 1;
579560
580561 /* Are we allowed to read that many bytes? */
581562 if (rle_count > (len - count)) {
582
- DPRINTK (KERN_DEBUG "%s: leaving %d RLE bytes "
583
- "for next time\n", port->name,
584
- rle_count);
563
+ pr_debug("%s: leaving %d RLE bytes for next time\n",
564
+ port->name, rle_count);
585565 break;
586566 }
587567
....@@ -596,11 +576,10 @@
596576 PARPORT_STATUS_ACK)) {
597577 /* It's gone wrong. Return what data we have
598578 to the caller. */
599
- DPRINTK (KERN_DEBUG "ECP read timed out at 45\n");
579
+ pr_debug("ECP read timed out at 45\n");
600580
601581 if (command)
602
- printk (KERN_WARNING
603
- "%s: command ignored (%02x)\n",
582
+ pr_warn("%s: command ignored (%02x)\n",
604583 port->name, byte);
605584
606585 break;
....@@ -620,7 +599,7 @@
620599 memset (buf, byte, rle_count);
621600 buf += rle_count;
622601 count += rle_count;
623
- DPRINTK (KERN_DEBUG "%s: decompressed to %d bytes\n",
602
+ pr_debug("%s: decompressed to %d bytes\n",
624603 port->name, rle_count);
625604 } else {
626605 /* Normal data byte. */
....@@ -686,7 +665,7 @@
686665 }
687666
688667 /* Time for Host Transfer Recovery (page 41 of IEEE1284) */
689
- DPRINTK (KERN_DEBUG "%s: ECP transfer stalled!\n", port->name);
668
+ pr_debug("%s: ECP transfer stalled!\n", port->name);
690669
691670 parport_frob_control (port, PARPORT_CONTROL_INIT,
692671 PARPORT_CONTROL_INIT);
....@@ -702,8 +681,7 @@
702681 if (!(parport_read_status (port) & PARPORT_STATUS_PAPEROUT))
703682 break;
704683
705
- DPRINTK (KERN_DEBUG "%s: Host transfer recovered\n",
706
- port->name);
684
+ pr_debug("%s: Host transfer recovered\n", port->name);
707685
708686 if (time_after_eq (jiffies, expire)) break;
709687 goto try_again;