hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/parport/parport_pc.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /* Low-level parallel-port routines for 8255-based PC-style hardware.
23 *
34 * Authors: Phil Blundell <philb@gnu.org>
....@@ -86,13 +87,6 @@
8687
8788 #undef DEBUG
8889
89
-#ifdef DEBUG
90
-#define DPRINTK printk
91
-#else
92
-#define DPRINTK(stuff...)
93
-#endif
94
-
95
-
9690 #define NR_SUPERIOS 3
9791 static struct superio_struct { /* For Super-IO chips autodetection */
9892 int io;
....@@ -117,8 +111,8 @@
117111 if (m != 0xff)
118112 ectr = inb(ECONTROL(pb));
119113
120
- DPRINTK(KERN_DEBUG "frob_econtrol(%02x,%02x): %02x -> %02x\n",
121
- m, v, ectr, (ectr & ~m) ^ v);
114
+ pr_debug("frob_econtrol(%02x,%02x): %02x -> %02x\n",
115
+ m, v, ectr, (ectr & ~m) ^ v);
122116
123117 outb((ectr & ~m) ^ v, ECONTROL(pb));
124118 }
....@@ -141,7 +135,7 @@
141135 unsigned char oecr;
142136 int mode;
143137
144
- DPRINTK(KERN_INFO "parport change_mode ECP-ISA to mode 0x%02x\n", m);
138
+ pr_debug("parport change_mode ECP-ISA to mode 0x%02x\n", m);
145139
146140 if (!priv->ecr) {
147141 printk(KERN_DEBUG "change_mode: but there's no ECR!\n");
....@@ -297,8 +291,8 @@
297291 status = inb(STATUS(port));
298292 if (status & 0x01) {
299293 /* EPP timeout should never occur... */
300
- printk(KERN_DEBUG
301
-"%s: EPP timeout occurred while talking to w91284pic (should not have done)\n", port->name);
294
+ printk(KERN_DEBUG "%s: EPP timeout occurred while talking to w91284pic (should not have done)\n",
295
+ port->name);
302296 clear_epp_timeout(port);
303297 }
304298 }
....@@ -474,7 +468,7 @@
474468 const unsigned char *bufp = buf;
475469 size_t left = length;
476470 unsigned long expire = jiffies + port->physport->cad->timeout;
477
- const int fifo = FIFO(port);
471
+ const unsigned long fifo = FIFO(port);
478472 int poll_for = 8; /* 80 usecs */
479473 const struct parport_pc_private *priv = port->physport->private_data;
480474 const int fifo_depth = priv->fifo_depth;
....@@ -726,7 +720,7 @@
726720 r = change_mode(port, ECR_PPF); /* Parallel port FIFO */
727721 if (r)
728722 printk(KERN_DEBUG "%s: Warning change_mode ECR_PPF failed\n",
729
- port->name);
723
+ port->name);
730724
731725 port->physport->ieee1284.phase = IEEE1284_PH_FWD_DATA;
732726
....@@ -769,9 +763,8 @@
769763 PARPORT_STATUS_BUSY,
770764 PARPORT_STATUS_BUSY);
771765 if (r)
772
- printk(KERN_DEBUG
773
- "%s: BUSY timeout (%d) in compat_write_block_pio\n",
774
- port->name, r);
766
+ printk(KERN_DEBUG "%s: BUSY timeout (%d) in compat_write_block_pio\n",
767
+ port->name, r);
775768
776769 port->physport->ieee1284.phase = IEEE1284_PH_FWD_IDLE;
777770
....@@ -809,8 +802,8 @@
809802 PARPORT_STATUS_PAPEROUT,
810803 PARPORT_STATUS_PAPEROUT);
811804 if (r) {
812
- printk(KERN_DEBUG "%s: PError timeout (%d) "
813
- "in ecp_write_block_pio\n", port->name, r);
805
+ printk(KERN_DEBUG "%s: PError timeout (%d) in ecp_write_block_pio\n",
806
+ port->name, r);
814807 }
815808 }
816809
....@@ -823,7 +816,7 @@
823816 r = change_mode(port, ECR_ECP); /* ECP FIFO */
824817 if (r)
825818 printk(KERN_DEBUG "%s: Warning change_mode ECR_ECP failed\n",
826
- port->name);
819
+ port->name);
827820 port->physport->ieee1284.phase = IEEE1284_PH_FWD_DATA;
828821
829822 /* Write the data to the FIFO. */
....@@ -866,8 +859,8 @@
866859 parport_frob_control(port, PARPORT_CONTROL_INIT, 0);
867860 r = parport_wait_peripheral(port, PARPORT_STATUS_PAPEROUT, 0);
868861 if (r)
869
- printk(KERN_DEBUG "%s: PE,1 timeout (%d) "
870
- "in ecp_write_block_pio\n", port->name, r);
862
+ printk(KERN_DEBUG "%s: PE,1 timeout (%d) in ecp_write_block_pio\n",
863
+ port->name, r);
871864
872865 parport_frob_control(port,
873866 PARPORT_CONTROL_INIT,
....@@ -876,17 +869,16 @@
876869 PARPORT_STATUS_PAPEROUT,
877870 PARPORT_STATUS_PAPEROUT);
878871 if (r)
879
- printk(KERN_DEBUG "%s: PE,2 timeout (%d) "
880
- "in ecp_write_block_pio\n", port->name, r);
872
+ printk(KERN_DEBUG "%s: PE,2 timeout (%d) in ecp_write_block_pio\n",
873
+ port->name, r);
881874 }
882875
883876 r = parport_wait_peripheral(port,
884877 PARPORT_STATUS_BUSY,
885878 PARPORT_STATUS_BUSY);
886879 if (r)
887
- printk(KERN_DEBUG
888
- "%s: BUSY timeout (%d) in ecp_write_block_pio\n",
889
- port->name, r);
880
+ printk(KERN_DEBUG "%s: BUSY timeout (%d) in ecp_write_block_pio\n",
881
+ port->name, r);
890882
891883 port->physport->ieee1284.phase = IEEE1284_PH_FWD_IDLE;
892884
....@@ -981,28 +973,24 @@
981973 outb(0xaa, io);
982974
983975 if (verbose_probing) {
984
- printk(KERN_INFO
985
- "SMSC 37c669 LPT Config: cr_1=0x%02x, 4=0x%02x, "
986
- "A=0x%2x, 23=0x%02x, 26=0x%02x, 27=0x%02x\n",
976
+ pr_info("SMSC 37c669 LPT Config: cr_1=0x%02x, 4=0x%02x, A=0x%2x, 23=0x%02x, 26=0x%02x, 27=0x%02x\n",
987977 cr1, cr4, cra, cr23, cr26, cr27);
988978
989979 /* The documentation calls DMA and IRQ-Lines by letters, so
990980 the board maker can/will wire them
991981 appropriately/randomly... G=reserved H=IDE-irq, */
992
- printk(KERN_INFO
993
- "SMSC LPT Config: io=0x%04x, irq=%c, dma=%c, fifo threshold=%d\n",
994
- cr23 * 4,
995
- (cr27 & 0x0f) ? 'A' - 1 + (cr27 & 0x0f) : '-',
996
- (cr26 & 0x0f) ? 'A' - 1 + (cr26 & 0x0f) : '-',
997
- cra & 0x0f);
998
- printk(KERN_INFO "SMSC LPT Config: enabled=%s power=%s\n",
999
- (cr23 * 4 >= 0x100) ? "yes" : "no",
1000
- (cr1 & 4) ? "yes" : "no");
1001
- printk(KERN_INFO
1002
- "SMSC LPT Config: Port mode=%s, EPP version =%s\n",
1003
- (cr1 & 0x08) ? "Standard mode only (SPP)"
1004
- : modes[cr4 & 0x03],
1005
- (cr4 & 0x40) ? "1.7" : "1.9");
982
+ pr_info("SMSC LPT Config: io=0x%04x, irq=%c, dma=%c, fifo threshold=%d\n",
983
+ cr23 * 4,
984
+ (cr27 & 0x0f) ? 'A' - 1 + (cr27 & 0x0f) : '-',
985
+ (cr26 & 0x0f) ? 'A' - 1 + (cr26 & 0x0f) : '-',
986
+ cra & 0x0f);
987
+ pr_info("SMSC LPT Config: enabled=%s power=%s\n",
988
+ (cr23 * 4 >= 0x100) ? "yes" : "no",
989
+ (cr1 & 4) ? "yes" : "no");
990
+ pr_info("SMSC LPT Config: Port mode=%s, EPP version =%s\n",
991
+ (cr1 & 0x08) ? "Standard mode only (SPP)"
992
+ : modes[cr4 & 0x03],
993
+ (cr4 & 0x40) ? "1.7" : "1.9");
1006994 }
1007995
1008996 /* Heuristics ! BIOS setup for this mainboard device limits
....@@ -1012,7 +1000,7 @@
10121000 if (cr23 * 4 >= 0x100) { /* if active */
10131001 s = find_free_superio();
10141002 if (s == NULL)
1015
- printk(KERN_INFO "Super-IO: too many chips!\n");
1003
+ pr_info("Super-IO: too many chips!\n");
10161004 else {
10171005 int d;
10181006 switch (cr23 * 4) {
....@@ -1077,26 +1065,24 @@
10771065 outb(0xaa, io);
10781066
10791067 if (verbose_probing) {
1080
- printk(KERN_INFO
1081
- "Winbond LPT Config: cr_30=%02x 60,61=%02x%02x 70=%02x 74=%02x, f0=%02x\n",
1082
- cr30, cr60, cr61, cr70, cr74, crf0);
1083
- printk(KERN_INFO "Winbond LPT Config: active=%s, io=0x%02x%02x irq=%d, ",
1084
- (cr30 & 0x01) ? "yes" : "no", cr60, cr61, cr70 & 0x0f);
1068
+ pr_info("Winbond LPT Config: cr_30=%02x 60,61=%02x%02x 70=%02x 74=%02x, f0=%02x\n",
1069
+ cr30, cr60, cr61, cr70, cr74, crf0);
1070
+ pr_info("Winbond LPT Config: active=%s, io=0x%02x%02x irq=%d, ",
1071
+ (cr30 & 0x01) ? "yes" : "no", cr60, cr61, cr70 & 0x0f);
10851072 if ((cr74 & 0x07) > 3)
10861073 pr_cont("dma=none\n");
10871074 else
10881075 pr_cont("dma=%d\n", cr74 & 0x07);
1089
- printk(KERN_INFO
1090
- "Winbond LPT Config: irqtype=%s, ECP fifo threshold=%d\n",
1091
- irqtypes[crf0>>7], (crf0>>3)&0x0f);
1092
- printk(KERN_INFO "Winbond LPT Config: Port mode=%s\n",
1093
- modes[crf0 & 0x07]);
1076
+ pr_info("Winbond LPT Config: irqtype=%s, ECP fifo threshold=%d\n",
1077
+ irqtypes[crf0 >> 7], (crf0 >> 3) & 0x0f);
1078
+ pr_info("Winbond LPT Config: Port mode=%s\n",
1079
+ modes[crf0 & 0x07]);
10941080 }
10951081
10961082 if (cr30 & 0x01) { /* the settings can be interrogated later ... */
10971083 s = find_free_superio();
10981084 if (s == NULL)
1099
- printk(KERN_INFO "Super-IO: too many chips!\n");
1085
+ pr_info("Super-IO: too many chips!\n");
11001086 else {
11011087 s->io = (cr60 << 8) | cr61;
11021088 s->irq = cr70 & 0x0f;
....@@ -1150,9 +1136,8 @@
11501136 progif = 0;
11511137
11521138 if (verbose_probing)
1153
- printk(KERN_INFO "Winbond chip at EFER=0x%x key=0x%02x "
1154
- "devid=%02x devrev=%02x oldid=%02x type=%s\n",
1155
- efer, key, devid, devrev, oldid, type);
1139
+ pr_info("Winbond chip at EFER=0x%x key=0x%02x devid=%02x devrev=%02x oldid=%02x type=%s\n",
1140
+ efer, key, devid, devrev, oldid, type);
11561141
11571142 if (progif == 2)
11581143 show_parconfig_winbond(efer, key);
....@@ -1183,9 +1168,8 @@
11831168 type = "37c666GT";
11841169
11851170 if (verbose_probing)
1186
- printk(KERN_INFO "SMSC chip at EFER=0x%x "
1187
- "key=0x%02x devid=%02x devrev=%02x type=%s\n",
1188
- efer, key, devid, devrev, type);
1171
+ pr_info("SMSC chip at EFER=0x%x key=0x%02x devid=%02x devrev=%02x type=%s\n",
1172
+ efer, key, devid, devrev, type);
11891173
11901174 if (func)
11911175 func(efer, key);
....@@ -1357,7 +1341,7 @@
13571341 dev |= inb(0x2f);
13581342 if (dev == 0x8712 || dev == 0x8705 || dev == 0x8715 ||
13591343 dev == 0x8716 || dev == 0x8718 || dev == 0x8726) {
1360
- printk(KERN_INFO "IT%04X SuperIO detected.\n", dev);
1344
+ pr_info("IT%04X SuperIO detected\n", dev);
13611345 outb(0x07, 0x2E); /* Parallel Port */
13621346 outb(0x03, 0x2F);
13631347 outb(0xF0, 0x2E); /* BOOT 0x80 off */
....@@ -1444,8 +1428,8 @@
14441428 if (user_specified)
14451429 /* That didn't work, but the user thinks there's a
14461430 * port here. */
1447
- printk(KERN_INFO "parport 0x%lx (WARNING): CTR: "
1448
- "wrote 0x%02x, read 0x%02x\n", pb->base, w, r);
1431
+ pr_info("parport 0x%lx (WARNING): CTR: wrote 0x%02x, read 0x%02x\n",
1432
+ pb->base, w, r);
14491433
14501434 /* Try the data register. The data lines aren't tri-stated at
14511435 * this stage, so we expect back what we wrote. */
....@@ -1463,10 +1447,9 @@
14631447 if (user_specified) {
14641448 /* Didn't work, but the user is convinced this is the
14651449 * place. */
1466
- printk(KERN_INFO "parport 0x%lx (WARNING): DATA: "
1467
- "wrote 0x%02x, read 0x%02x\n", pb->base, w, r);
1468
- printk(KERN_INFO "parport 0x%lx: You gave this address, "
1469
- "but there is probably no parallel port there!\n",
1450
+ pr_info("parport 0x%lx (WARNING): DATA: wrote 0x%02x, read 0x%02x\n",
1451
+ pb->base, w, r);
1452
+ pr_info("parport 0x%lx: You gave this address, but there is probably no parallel port there!\n",
14701453 pb->base);
14711454 }
14721455
....@@ -1619,7 +1602,7 @@
16191602 if (i <= priv->fifo_depth) {
16201603 if (verbose_probing)
16211604 printk(KERN_DEBUG "0x%lx: writeIntrThreshold is %d\n",
1622
- pb->base, i);
1605
+ pb->base, i);
16231606 } else
16241607 /* Number of bytes we know we can write if we get an
16251608 interrupt. */
....@@ -1641,7 +1624,7 @@
16411624
16421625 if (i <= priv->fifo_depth) {
16431626 if (verbose_probing)
1644
- printk(KERN_INFO "0x%lx: readIntrThreshold is %d\n",
1627
+ pr_info("0x%lx: readIntrThreshold is %d\n",
16451628 pb->base, i);
16461629 } else
16471630 /* Number of bytes we can read if we get an interrupt. */
....@@ -1656,18 +1639,15 @@
16561639 switch (pword) {
16571640 case 0:
16581641 pword = 2;
1659
- printk(KERN_WARNING "0x%lx: Unsupported pword size!\n",
1660
- pb->base);
1642
+ pr_warn("0x%lx: Unsupported pword size!\n", pb->base);
16611643 break;
16621644 case 2:
16631645 pword = 4;
1664
- printk(KERN_WARNING "0x%lx: Unsupported pword size!\n",
1665
- pb->base);
1646
+ pr_warn("0x%lx: Unsupported pword size!\n", pb->base);
16661647 break;
16671648 default:
1668
- printk(KERN_WARNING "0x%lx: Unknown implementation ID\n",
1669
- pb->base);
1670
- /* Assume 1 */
1649
+ pr_warn("0x%lx: Unknown implementation ID\n", pb->base);
1650
+ fallthrough; /* Assume 1 */
16711651 case 1:
16721652 pword = 1;
16731653 }
....@@ -1675,14 +1655,14 @@
16751655
16761656 if (verbose_probing) {
16771657 printk(KERN_DEBUG "0x%lx: PWord is %d bits\n",
1678
- pb->base, 8 * pword);
1658
+ pb->base, 8 * pword);
16791659
1680
- printk(KERN_DEBUG "0x%lx: Interrupts are ISA-%s\n", pb->base,
1681
- config & 0x80 ? "Level" : "Pulses");
1660
+ printk(KERN_DEBUG "0x%lx: Interrupts are ISA-%s\n",
1661
+ pb->base, config & 0x80 ? "Level" : "Pulses");
16821662
16831663 configb = inb(CONFIGB(pb));
16841664 printk(KERN_DEBUG "0x%lx: ECP port cfgA=0x%02x cfgB=0x%02x\n",
1685
- pb->base, config, configb);
1665
+ pb->base, config, configb);
16861666 printk(KERN_DEBUG "0x%lx: ECP settings irq=", pb->base);
16871667 if ((configb >> 3) & 0x07)
16881668 pr_cont("%d", intrline[(configb >> 3) & 0x07]);
....@@ -2106,9 +2086,9 @@
21062086
21072087 p->size = (p->modes & PARPORT_MODE_EPP) ? 8 : 3;
21082088
2109
- printk(KERN_INFO "%s: PC-style at 0x%lx", p->name, p->base);
2089
+ pr_info("%s: PC-style at 0x%lx", p->name, p->base);
21102090 if (p->base_hi && priv->ecr)
2111
- printk(KERN_CONT " (0x%lx)", p->base_hi);
2091
+ pr_cont(" (0x%lx)", p->base_hi);
21122092 if (p->irq == PARPORT_IRQ_AUTO) {
21132093 p->irq = PARPORT_IRQ_NONE;
21142094 parport_irq_probe(p);
....@@ -2119,7 +2099,7 @@
21192099 p->irq = PARPORT_IRQ_NONE;
21202100 }
21212101 if (p->irq != PARPORT_IRQ_NONE) {
2122
- printk(KERN_CONT ", irq %d", p->irq);
2102
+ pr_cont(", irq %d", p->irq);
21232103 priv->ctr_writable |= 0x10;
21242104
21252105 if (p->dma == PARPORT_DMA_AUTO) {
....@@ -2143,41 +2123,39 @@
21432123 /* p->ops->ecp_read_data = parport_pc_ecp_read_block_pio; */
21442124 #endif /* IEEE 1284 support */
21452125 if (p->dma != PARPORT_DMA_NONE) {
2146
- printk(KERN_CONT ", dma %d", p->dma);
2126
+ pr_cont(", dma %d", p->dma);
21472127 p->modes |= PARPORT_MODE_DMA;
21482128 } else
2149
- printk(KERN_CONT ", using FIFO");
2129
+ pr_cont(", using FIFO");
21502130 } else
21512131 /* We can't use the DMA channel after all. */
21522132 p->dma = PARPORT_DMA_NONE;
21532133 #endif /* Allowed to use FIFO/DMA */
21542134
2155
- printk(KERN_CONT " [");
2135
+ pr_cont(" [");
21562136
2157
-#define printmode(x) \
2158
- {\
2159
- if (p->modes & PARPORT_MODE_##x) {\
2160
- printk(KERN_CONT "%s%s", f ? "," : "", #x);\
2161
- f++;\
2162
- } \
2163
- }
2137
+#define printmode(x) \
2138
+do { \
2139
+ if (p->modes & PARPORT_MODE_##x) \
2140
+ pr_cont("%s%s", f++ ? "," : "", #x); \
2141
+} while (0)
21642142
21652143 {
21662144 int f = 0;
21672145 printmode(PCSPP);
21682146 printmode(TRISTATE);
2169
- printmode(COMPAT)
2147
+ printmode(COMPAT);
21702148 printmode(EPP);
21712149 printmode(ECP);
21722150 printmode(DMA);
21732151 }
21742152 #undef printmode
21752153 #ifndef CONFIG_PARPORT_1284
2176
- printk(KERN_CONT "(,...)");
2154
+ pr_cont("(,...)");
21772155 #endif /* CONFIG_PARPORT_1284 */
2178
- printk(KERN_CONT "]\n");
2156
+ pr_cont("]\n");
21792157 if (probedirq != PARPORT_IRQ_NONE)
2180
- printk(KERN_INFO "%s: irq %d detected\n", p->name, probedirq);
2158
+ pr_info("%s: irq %d detected\n", p->name, probedirq);
21812159
21822160 /* If No ECP release the ports grabbed above. */
21832161 if (ECR_res && (p->modes & PARPORT_MODE_ECP) == 0) {
....@@ -2192,8 +2170,7 @@
21922170 if (p->irq != PARPORT_IRQ_NONE) {
21932171 if (request_irq(p->irq, parport_irq_handler,
21942172 irqflags, p->name, p)) {
2195
- printk(KERN_WARNING "%s: irq %d in use, "
2196
- "resorting to polled operation\n",
2173
+ pr_warn("%s: irq %d in use, resorting to polled operation\n",
21972174 p->name, p->irq);
21982175 p->irq = PARPORT_IRQ_NONE;
21992176 p->dma = PARPORT_DMA_NONE;
....@@ -2203,8 +2180,7 @@
22032180 #ifdef HAS_DMA
22042181 if (p->dma != PARPORT_DMA_NONE) {
22052182 if (request_dma(p->dma, p->name)) {
2206
- printk(KERN_WARNING "%s: dma %d in use, "
2207
- "resorting to PIO operation\n",
2183
+ pr_warn("%s: dma %d in use, resorting to PIO operation\n",
22082184 p->name, p->dma);
22092185 p->dma = PARPORT_DMA_NONE;
22102186 } else {
....@@ -2214,9 +2190,7 @@
22142190 &priv->dma_handle,
22152191 GFP_KERNEL);
22162192 if (!priv->dma_buf) {
2217
- printk(KERN_WARNING "%s: "
2218
- "cannot get buffer for DMA, "
2219
- "resorting to PIO operation\n",
2193
+ pr_warn("%s: cannot get buffer for DMA, resorting to PIO operation\n",
22202194 p->name);
22212195 free_dma(p->dma);
22222196 p->dma = PARPORT_DMA_NONE;
....@@ -2312,7 +2286,7 @@
23122286 int irq;
23132287 int i;
23142288
2315
- DPRINTK(KERN_DEBUG "sio_ite_8872_probe()\n");
2289
+ pr_debug("sio_ite_8872_probe()\n");
23162290
23172291 /* make sure which one chip */
23182292 for (i = 0; i < 5; i++) {
....@@ -2329,7 +2303,7 @@
23292303 }
23302304 }
23312305 if (i >= 5) {
2332
- printk(KERN_INFO "parport_pc: cannot find ITE8872 INTA\n");
2306
+ pr_info("parport_pc: cannot find ITE8872 INTA\n");
23332307 return 0;
23342308 }
23352309
....@@ -2338,29 +2312,28 @@
23382312
23392313 switch (type) {
23402314 case 0x2:
2341
- printk(KERN_INFO "parport_pc: ITE8871 found (1P)\n");
2315
+ pr_info("parport_pc: ITE8871 found (1P)\n");
23422316 ite8872set = 0x64200000;
23432317 break;
23442318 case 0xa:
2345
- printk(KERN_INFO "parport_pc: ITE8875 found (1P)\n");
2319
+ pr_info("parport_pc: ITE8875 found (1P)\n");
23462320 ite8872set = 0x64200000;
23472321 break;
23482322 case 0xe:
2349
- printk(KERN_INFO "parport_pc: ITE8872 found (2S1P)\n");
2323
+ pr_info("parport_pc: ITE8872 found (2S1P)\n");
23502324 ite8872set = 0x64e00000;
23512325 break;
23522326 case 0x6:
2353
- printk(KERN_INFO "parport_pc: ITE8873 found (1S)\n");
2327
+ pr_info("parport_pc: ITE8873 found (1S)\n");
23542328 release_region(inta_addr[i], 32);
23552329 return 0;
23562330 case 0x8:
2357
- printk(KERN_INFO "parport_pc: ITE8874 found (2S)\n");
2331
+ pr_info("parport_pc: ITE8874 found (2S)\n");
23582332 release_region(inta_addr[i], 32);
23592333 return 0;
23602334 default:
2361
- printk(KERN_INFO "parport_pc: unknown ITE887x\n");
2362
- printk(KERN_INFO "parport_pc: please mail 'lspci -nvv' "
2363
- "output to Rich.Liu@ite.com.tw\n");
2335
+ pr_info("parport_pc: unknown ITE887x\n");
2336
+ pr_info("parport_pc: please mail 'lspci -nvv' output to Rich.Liu@ite.com.tw\n");
23642337 release_region(inta_addr[i], 32);
23652338 return 0;
23662339 }
....@@ -2378,11 +2351,9 @@
23782351 pci_write_config_dword(pdev, 0x9c,
23792352 ite8872set | (ite8872_irq * 0x11111));
23802353
2381
- DPRINTK(KERN_DEBUG "ITE887x: The IRQ is %d.\n", ite8872_irq);
2382
- DPRINTK(KERN_DEBUG "ITE887x: The PARALLEL I/O port is 0x%x.\n",
2383
- ite8872_lpt);
2384
- DPRINTK(KERN_DEBUG "ITE887x: The PARALLEL I/O porthi is 0x%x.\n",
2385
- ite8872_lpthi);
2354
+ pr_debug("ITE887x: The IRQ is %d\n", ite8872_irq);
2355
+ pr_debug("ITE887x: The PARALLEL I/O port is 0x%x\n", ite8872_lpt);
2356
+ pr_debug("ITE887x: The PARALLEL I/O porthi is 0x%x\n", ite8872_lpthi);
23862357
23872358 /* Let the user (or defaults) steer us away from interrupts */
23882359 irq = ite8872_irq;
....@@ -2395,9 +2366,8 @@
23952366 release_region(inta_addr[i], 32);
23962367 if (parport_pc_probe_port(ite8872_lpt, ite8872_lpthi,
23972368 irq, PARPORT_DMA_NONE, &pdev->dev, 0)) {
2398
- printk(KERN_INFO
2399
- "parport_pc: ITE 8872 parallel port: io=0x%X",
2400
- ite8872_lpt);
2369
+ pr_info("parport_pc: ITE 8872 parallel port: io=0x%X",
2370
+ ite8872_lpt);
24012371 if (irq != PARPORT_IRQ_NONE)
24022372 pr_cont(", irq=%d", irq);
24032373 pr_cont("\n");
....@@ -2470,8 +2440,7 @@
24702440 have_epp = 1;
24712441 break;
24722442 default:
2473
- printk(KERN_DEBUG
2474
- "parport_pc: probing current configuration\n");
2443
+ printk(KERN_DEBUG "parport_pc: probing current configuration\n");
24752444 siofunc = VIA_FUNCTION_PROBE;
24762445 break;
24772446 }
....@@ -2507,12 +2476,11 @@
25072476 port1 = inb(VIA_CONFIG_DATA) << 2;
25082477
25092478 printk(KERN_DEBUG "parport_pc: Current parallel port base: 0x%X\n",
2510
- port1);
2479
+ port1);
25112480 if (port1 == 0x3BC && have_epp) {
25122481 outb(via->viacfg_parport_base, VIA_CONFIG_INDEX);
25132482 outb((0x378 >> 2), VIA_CONFIG_DATA);
2514
- printk(KERN_DEBUG
2515
- "parport_pc: Parallel port base changed to 0x378\n");
2483
+ printk(KERN_DEBUG "parport_pc: Parallel port base changed to 0x378\n");
25162484 port1 = 0x378;
25172485 }
25182486
....@@ -2524,7 +2492,7 @@
25242492 pci_write_config_byte(pdev, via->via_pci_superio_config_reg, tmp);
25252493
25262494 if (siofunc == VIA_FUNCTION_PARPORT_DISABLE) {
2527
- printk(KERN_INFO "parport_pc: VIA parallel port disabled in BIOS\n");
2495
+ pr_info("parport_pc: VIA parallel port disabled in BIOS\n");
25282496 return 0;
25292497 }
25302498
....@@ -2557,9 +2525,8 @@
25572525 case 0x278:
25582526 port2 = 0x678; break;
25592527 default:
2560
- printk(KERN_INFO
2561
- "parport_pc: Weird VIA parport base 0x%X, ignoring\n",
2562
- port1);
2528
+ pr_info("parport_pc: Weird VIA parport base 0x%X, ignoring\n",
2529
+ port1);
25632530 return 0;
25642531 }
25652532
....@@ -2578,8 +2545,7 @@
25782545
25792546 /* finally, do the probe with values obtained */
25802547 if (parport_pc_probe_port(port1, port2, irq, dma, &pdev->dev, 0)) {
2581
- printk(KERN_INFO
2582
- "parport_pc: VIA parallel port: io=0x%X", port1);
2548
+ pr_info("parport_pc: VIA parallel port: io=0x%X", port1);
25832549 if (irq != PARPORT_IRQ_NONE)
25842550 pr_cont(", irq=%d", irq);
25852551 if (dma != PARPORT_DMA_NONE)
....@@ -2588,7 +2554,7 @@
25882554 return 1;
25892555 }
25902556
2591
- printk(KERN_WARNING "parport_pc: Strange, can't probe VIA parallel port: io=0x%X, irq=%d, dma=%d\n",
2557
+ pr_warn("parport_pc: Strange, can't probe VIA parallel port: io=0x%X, irq=%d, dma=%d\n",
25922558 port1, irq, dma);
25932559 return 0;
25942560 }
....@@ -2853,14 +2819,12 @@
28532819 /* TODO: test if sharing interrupts works */
28542820 irq = dev->irq;
28552821 if (irq == IRQ_NONE) {
2856
- printk(KERN_DEBUG
2857
- "PCI parallel port detected: %04x:%04x, I/O at %#lx(%#lx)\n",
2858
- id->vendor, id->device, io_lo, io_hi);
2822
+ printk(KERN_DEBUG "PCI parallel port detected: %04x:%04x, I/O at %#lx(%#lx)\n",
2823
+ id->vendor, id->device, io_lo, io_hi);
28592824 irq = PARPORT_IRQ_NONE;
28602825 } else {
2861
- printk(KERN_DEBUG
2862
- "PCI parallel port detected: %04x:%04x, I/O at %#lx(%#lx), IRQ %d\n",
2863
- id->vendor, id->device, io_lo, io_hi, irq);
2826
+ printk(KERN_DEBUG "PCI parallel port detected: %04x:%04x, I/O at %#lx(%#lx), IRQ %d\n",
2827
+ id->vendor, id->device, io_lo, io_hi, irq);
28642828 }
28652829 data->ports[count] =
28662830 parport_pc_probe_port(io_lo, io_hi, irq,
....@@ -3110,7 +3074,7 @@
31103074 if (ep != s)
31113075 *val = r;
31123076 else {
3113
- printk(KERN_ERR "parport: bad specifier `%s'\n", s);
3077
+ pr_err("parport: bad specifier `%s'\n", s);
31143078 return -1;
31153079 }
31163080 }
....@@ -3132,8 +3096,8 @@
31323096 #ifdef CONFIG_PCI
31333097 static int __init parport_init_mode_setup(char *str)
31343098 {
3135
- printk(KERN_DEBUG
3136
- "parport_pc.c: Specified parameter parport_init_mode=%s\n", str);
3099
+ printk(KERN_DEBUG "parport_pc.c: Specified parameter parport_init_mode=%s\n",
3100
+ str);
31373101
31383102 if (!strcmp(str, "spp"))
31393103 parport_init_mode = 1;
....@@ -3200,10 +3164,7 @@
32003164 irqval[0] = val;
32013165 break;
32023166 default:
3203
- printk(KERN_WARNING
3204
- "parport_pc: irq specified "
3205
- "without base address. Use 'io=' "
3206
- "to specify one\n");
3167
+ pr_warn("parport_pc: irq specified without base address. Use 'io=' to specify one\n");
32073168 }
32083169
32093170 if (dma[0] && !parport_parse_dma(dma[0], &val))
....@@ -3213,10 +3174,7 @@
32133174 dmaval[0] = val;
32143175 break;
32153176 default:
3216
- printk(KERN_WARNING
3217
- "parport_pc: dma specified "
3218
- "without base address. Use 'io=' "
3219
- "to specify one\n");
3177
+ pr_warn("parport_pc: dma specified without base address. Use 'io=' to specify one\n");
32203178 }
32213179 }
32223180 return 0;
....@@ -3255,12 +3213,12 @@
32553213
32563214 val = simple_strtoul(str, &endptr, 0);
32573215 if (endptr == str) {
3258
- printk(KERN_WARNING "parport=%s not understood\n", str);
3216
+ pr_warn("parport=%s not understood\n", str);
32593217 return 1;
32603218 }
32613219
32623220 if (parport_setup_ptr == PARPORT_PC_MAX_PORTS) {
3263
- printk(KERN_ERR "parport=%s ignored, too many ports\n", str);
3221
+ pr_err("parport=%s ignored, too many ports\n", str);
32643222 return 1;
32653223 }
32663224