aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2006-03-04 19:31:22 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-03-05 16:25:40 -0500
commit7a171cdcb6ce82cc5e4bd7cb8eab172a43395f87 (patch)
tree7e06a79a43ca2a5e8d57d88b80c6ac2b1e72f246
parent501f74f29498543c27f4f9697f5c1e980dd2de0d (diff)
[SERIAL] Fix two bugs in parport_serial
Steinar H. Gunderson reported: - For some reason, it detects the 9845 as a 9735 -- it appears this is simply related to the ordering in parport_serial_pci_tbl[]. If we move the 9845 up above the 9735, it prints out 9710:9845, but no change in behaviour. (We didn't find out why this was the case; we left it alone since it didn't affect our problem.) - The card has no parallel port (at least no physical ones), yet it reports (via its subsystem ID of 0x0014) one parallel port and four serial ports. The probe for the parallel port fails, and the driver just aborts. Thus, it doesn't find the serial ports. Fix the debugging code to use dev_dbg, but don't bother displaying the PCI ID of the detected board (that's accessible via other means.) Also, arrange for parport_register() to return 0 even if it finds no ports. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--drivers/parport/parport_serial.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c
index 166de3507780..10845253c9e0 100644
--- a/drivers/parport/parport_serial.c
+++ b/drivers/parport/parport_serial.c
@@ -312,8 +312,7 @@ static int __devinit parport_register (struct pci_dev *dev,
312{ 312{
313 struct parport_pc_pci *card; 313 struct parport_pc_pci *card;
314 struct parport_serial_private *priv = pci_get_drvdata (dev); 314 struct parport_serial_private *priv = pci_get_drvdata (dev);
315 int i = id->driver_data, n; 315 int n, success = 0;
316 int success = 0;
317 316
318 priv->par = cards[id->driver_data]; 317 priv->par = cards[id->driver_data];
319 card = &priv->par; 318 card = &priv->par;
@@ -344,10 +343,8 @@ static int __devinit parport_register (struct pci_dev *dev,
344 "hi" as an offset (see SYBA 343 "hi" as an offset (see SYBA
345 def.) */ 344 def.) */
346 /* TODO: test if sharing interrupts works */ 345 /* TODO: test if sharing interrupts works */
347 printk (KERN_DEBUG "PCI parallel port detected: %04x:%04x, " 346 dev_dbg(&dev->dev, "PCI parallel port detected: I/O at "
348 "I/O at %#lx(%#lx)\n", 347 "%#lx(%#lx)\n", io_lo, io_hi);
349 parport_serial_pci_tbl[i].vendor,
350 parport_serial_pci_tbl[i].device, io_lo, io_hi);
351 port = parport_pc_probe_port (io_lo, io_hi, PARPORT_IRQ_NONE, 348 port = parport_pc_probe_port (io_lo, io_hi, PARPORT_IRQ_NONE,
352 PARPORT_DMA_NONE, dev); 349 PARPORT_DMA_NONE, dev);
353 if (port) { 350 if (port) {
@@ -359,7 +356,7 @@ static int __devinit parport_register (struct pci_dev *dev,
359 if (card->postinit_hook) 356 if (card->postinit_hook)
360 card->postinit_hook (dev, card, !success); 357 card->postinit_hook (dev, card, !success);
361 358
362 return success ? 0 : 1; 359 return 0;
363} 360}
364 361
365static int __devinit parport_serial_pci_probe (struct pci_dev *dev, 362static int __devinit parport_serial_pci_probe (struct pci_dev *dev,