diff options
author | Frédéric Brière <fbriere@fbriere.net> | 2011-05-29 15:08:03 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-06-07 12:35:56 -0400 |
commit | 5bf8f501e05930364b345ed8710c5b1a13207134 (patch) | |
tree | d90861301e0c78a83bfc4575b9401dce05146a5b | |
parent | 7808edcd306f22aeb23775d34e70b7fa2f58b852 (diff) |
serial: 8250_pci: add .probe member to struct pci_serial_quirk
This function, if present, is called early on by the 8250_pci probe; it
can be used to reject devices meant for parport_serial. (The .init
function cannot be used for this purpose, as it is also called by
parport_serial.)
Signed-off-by: Frédéric Brière <fbriere@fbriere.net>
Acked-by: Alan Cox <alan@linux.intel.com>
Cc: linux-serial@vger.kernel.org
Cc: linux-parport@lists.infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/tty/serial/8250_pci.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/tty/serial/8250_pci.c b/drivers/tty/serial/8250_pci.c index 0b255cef57e..9b119fe9257 100644 --- a/drivers/tty/serial/8250_pci.c +++ b/drivers/tty/serial/8250_pci.c | |||
@@ -39,6 +39,7 @@ struct pci_serial_quirk { | |||
39 | u32 device; | 39 | u32 device; |
40 | u32 subvendor; | 40 | u32 subvendor; |
41 | u32 subdevice; | 41 | u32 subdevice; |
42 | int (*probe)(struct pci_dev *dev); | ||
42 | int (*init)(struct pci_dev *dev); | 43 | int (*init)(struct pci_dev *dev); |
43 | int (*setup)(struct serial_private *, | 44 | int (*setup)(struct serial_private *, |
44 | const struct pciserial_board *, | 45 | const struct pciserial_board *, |
@@ -2662,11 +2663,19 @@ EXPORT_SYMBOL_GPL(pciserial_resume_ports); | |||
2662 | static int __devinit | 2663 | static int __devinit |
2663 | pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent) | 2664 | pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent) |
2664 | { | 2665 | { |
2666 | struct pci_serial_quirk *quirk; | ||
2665 | struct serial_private *priv; | 2667 | struct serial_private *priv; |
2666 | const struct pciserial_board *board; | 2668 | const struct pciserial_board *board; |
2667 | struct pciserial_board tmp; | 2669 | struct pciserial_board tmp; |
2668 | int rc; | 2670 | int rc; |
2669 | 2671 | ||
2672 | quirk = find_quirk(dev); | ||
2673 | if (quirk->probe) { | ||
2674 | rc = quirk->probe(dev); | ||
2675 | if (rc) | ||
2676 | return rc; | ||
2677 | } | ||
2678 | |||
2670 | if (ent->driver_data >= ARRAY_SIZE(pci_boards)) { | 2679 | if (ent->driver_data >= ARRAY_SIZE(pci_boards)) { |
2671 | printk(KERN_ERR "pci_init_one: invalid driver_data: %ld\n", | 2680 | printk(KERN_ERR "pci_init_one: invalid driver_data: %ld\n", |
2672 | ent->driver_data); | 2681 | ent->driver_data); |