From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Adam Belay <ambx1@neo.rr.com>
Cc: linux-kernel@vger.kernel.org, Jaroslav Kysela <perex@suse.cz>,
Matthieu Castet <castet.matthieu@free.fr>,
Li Shaohua <shaohua.li@intel.com>, Andrew Morton <akpm@osdl.org>,
Thorsten Knabe <linux@thorsten-knabe.de>,
Uwe Bugla <uwe.bugla@gmx.de>, Takashi Iwai <tiwai@suse.de>
Subject: [PATCH 1/12] PNP: adjust pnp_register_card_driver() signature
Date: Wed, 22 Mar 2006 15:12:06 -0700 [thread overview]
Message-ID: <200603221512.06536.bjorn.helgaas@hp.com> (raw)
In-Reply-To: <200603221455.26230.bjorn.helgaas@hp.com>
Remove the assumption that pnp_register_card_driver() returns the
number of devices claimed.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Index: work-mm5/sound/isa/ad1816a/ad1816a.c
===================================================================
--- work-mm5.orig/sound/isa/ad1816a/ad1816a.c 2006-03-22 09:57:34.000000000 -0700
+++ work-mm5/sound/isa/ad1816a/ad1816a.c 2006-03-22 10:10:34.000000000 -0700
@@ -262,6 +262,8 @@
return 0;
}
+static unsigned int __devinitdata ad1816a_devices;
+
static int __devinit snd_ad1816a_pnp_detect(struct pnp_card_link *card,
const struct pnp_card_device_id *id)
{
@@ -275,6 +277,7 @@
if (res < 0)
return res;
dev++;
+ ad1816a_devices++;
return 0;
}
return -ENODEV;
@@ -297,10 +300,13 @@
static int __init alsa_card_ad1816a_init(void)
{
- int cards;
+ int err;
+
+ err = pnp_register_card_driver(&ad1816a_pnpc_driver);
+ if (err)
+ return err;
- cards = pnp_register_card_driver(&ad1816a_pnpc_driver);
- if (cards <= 0) {
+ if (!ad1816a_devices) {
pnp_unregister_card_driver(&ad1816a_pnpc_driver);
#ifdef MODULE
printk(KERN_ERR "no AD1816A based soundcards found.\n");
next prev parent reply other threads:[~2006-03-22 22:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-22 21:55 [PATCH 0/12] " Bjorn Helgaas
2006-03-22 22:12 ` Bjorn Helgaas [this message]
2006-03-22 22:12 ` [PATCH 2/12] " Bjorn Helgaas
2006-03-22 22:12 ` [PATCH 3/12] " Bjorn Helgaas
2006-03-22 22:12 ` [PATCH 4/12] " Bjorn Helgaas
2006-03-22 22:12 ` [PATCH 5/12] " Bjorn Helgaas
2006-03-22 22:12 ` [PATCH 6/12] " Bjorn Helgaas
2006-03-22 22:12 ` [PATCH 7/12] " Bjorn Helgaas
2006-03-22 22:12 ` [PATCH 8/12] " Bjorn Helgaas
2006-03-22 22:12 ` [PATCH 9/12] " Bjorn Helgaas
2006-03-22 22:13 ` [PATCH 10/12] " Bjorn Helgaas
2006-03-22 22:13 ` [PATCH 11/12] " Bjorn Helgaas
2006-03-22 22:13 ` [PATCH 12/12] " Bjorn Helgaas
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=200603221512.06536.bjorn.helgaas@hp.com \
--to=bjorn.helgaas@hp.com \
--cc=akpm@osdl.org \
--cc=ambx1@neo.rr.com \
--cc=castet.matthieu@free.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@thorsten-knabe.de \
--cc=perex@suse.cz \
--cc=shaohua.li@intel.com \
--cc=tiwai@suse.de \
--cc=uwe.bugla@gmx.de \
/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®