提交 7a171cdc 编写于 作者: R Russell King 提交者: Russell King

[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: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 501f74f2
......@@ -312,8 +312,7 @@ static int __devinit parport_register (struct pci_dev *dev,
{
struct parport_pc_pci *card;
struct parport_serial_private *priv = pci_get_drvdata (dev);
int i = id->driver_data, n;
int success = 0;
int n, success = 0;
priv->par = cards[id->driver_data];
card = &priv->par;
......@@ -344,10 +343,8 @@ static int __devinit parport_register (struct pci_dev *dev,
"hi" as an offset (see SYBA
def.) */
/* TODO: test if sharing interrupts works */
printk (KERN_DEBUG "PCI parallel port detected: %04x:%04x, "
"I/O at %#lx(%#lx)\n",
parport_serial_pci_tbl[i].vendor,
parport_serial_pci_tbl[i].device, io_lo, io_hi);
dev_dbg(&dev->dev, "PCI parallel port detected: I/O at "
"%#lx(%#lx)\n", io_lo, io_hi);
port = parport_pc_probe_port (io_lo, io_hi, PARPORT_IRQ_NONE,
PARPORT_DMA_NONE, dev);
if (port) {
......@@ -359,7 +356,7 @@ static int __devinit parport_register (struct pci_dev *dev,
if (card->postinit_hook)
card->postinit_hook (dev, card, !success);
return success ? 0 : 1;
return 0;
}
static int __devinit parport_serial_pci_probe (struct pci_dev *dev,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册