From: "Frédéric Brière" <fbriere@fbriere.net>
To: linux-kernel@vger.kernel.org
Cc: linux-serial@vger.kernel.org, linux-parport@lists.infradead.org
Subject: [PATCH 1/2] serial: 8250_pci: add .probe member to struct pci_serial_quirk
Date: Mon, 12 Jul 2010 11:49:42 -0400 [thread overview]
Message-ID: <1278949783-2820-1-git-send-email-fbriere@fbriere.net> (raw)
In-Reply-To: <20100712154448.GA2558@toroia.fbriere.dyndns.org>
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>
---
drivers/serial/8250_pci.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
index 01c012d..d9b9a63 100644
--- a/drivers/serial/8250_pci.c
+++ b/drivers/serial/8250_pci.c
@@ -41,6 +41,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 *,
@@ -2470,11 +2471,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.1
next prev parent reply other threads:[~2010-07-12 15:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-26 0:23 [PATCH] parport/serial: add support for Timedia/SUNIX cards to parport_serial Frédéric Brière
2010-07-08 11:11 ` Alan Cox
2010-07-12 15:44 ` Frédéric Brière
2010-07-12 15:49 ` Frédéric Brière [this message]
2010-07-12 15:49 ` [PATCH 2/2] " Frédéric Brière
2010-07-12 16:56 ` [PATCH] " Alan Cox
2011-05-29 19:08 [PATCH 1/2] serial: 8250_pci: add .probe member to struct pci_serial_quirk Frédéric Brière
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1278949783-2820-1-git-send-email-fbriere@fbriere.net \
--to=fbriere@fbriere.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parport@lists.infradead.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®