[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1306696084-17977-1-git-send-email-fbriere@fbriere.net>
Date: Sun, 29 May 2011 15:08:03 -0400
From: Frédéric Brière <fbriere@...iere.net>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...e.de>,
Alan Cox <alan@...ux.intel.com>, linux-serial@...r.kernel.org,
linux-parport@...ts.infradead.org
Subject: [PATCH 1/2] 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@...iere.net>
Cc: Greg Kroah-Hartman <gregkh@...e.de>
Cc: Alan Cox <alan@...ux.intel.com>
Cc: linux-serial@...r.kernel.org
Cc: linux-parport@...ts.infradead.org
---
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 4b4968a..e6fb67b 100644
--- a/drivers/tty/serial/8250_pci.c
+++ b/drivers/tty/serial/8250_pci.c
@@ -39,6 +39,7 @@ struct pci_serial_quirk {
u32 device;
u32 subvendor;
u32 subdevice;
+ int (*probe)(struct pci_dev *dev);
int (*init)(struct pci_dev *dev);
int (*setup)(struct serial_private *,
const struct pciserial_board *,
@@ -2581,11 +2582,19 @@ EXPORT_SYMBOL_GPL(pciserial_resume_ports);
static int __devinit
pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent)
{
+ struct pci_serial_quirk *quirk;
struct serial_private *priv;
const struct pciserial_board *board;
struct pciserial_board tmp;
int rc;
+ quirk = find_quirk(dev);
+ if (quirk->probe) {
+ rc = quirk->probe(dev);
+ if (rc)
+ return rc;
+ }
+
if (ent->driver_data >= ARRAY_SIZE(pci_boards)) {
printk(KERN_ERR "pci_init_one: invalid driver_data: %ld\n",
ent->driver_data);
--
1.7.5.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists