mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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>
Subject: [PATCH 8/9] cs4232: adjust pnp_register_driver signature
Date: Thu, 2 Mar 2006 16:09:51 -0700	[thread overview]
Message-ID: <200603021609.51563.bjorn.helgaas@hp.com> (raw)
In-Reply-To: <200603021601.27467.bjorn.helgaas@hp.com>

Remove the assumption that pnp_register_driver() returns the number of
devices claimed.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>

Index: work-mm4/sound/oss/cs4232.c
===================================================================
--- work-mm4.orig/sound/oss/cs4232.c	2006-01-02 20:21:10.000000000 -0700
+++ work-mm4/sound/oss/cs4232.c	2006-02-15 15:44:34.000000000 -0700
@@ -360,6 +360,8 @@
 static int __initdata synthirq	= -1;
 static int __initdata isapnp	= 1;
 
+static unsigned int cs4232_devices;
+
 MODULE_DESCRIPTION("CS4232 based soundcard driver"); 
 MODULE_AUTHOR("Hannu Savolainen, Paul Barton-Davis"); 
 MODULE_LICENSE("GPL");
@@ -421,6 +423,7 @@
 		return -ENODEV;
 	}
 	pnp_set_drvdata(dev,isapnpcfg);
+	cs4232_devices++;
 	return 0;
 }
 
@@ -455,10 +458,11 @@
 #endif
 	cfg.irq = -1;
 
-	if (isapnp &&
-	    (pnp_register_driver(&cs4232_driver) > 0)
-	)
-		return 0;
+	if (isapnp) {
+		pnp_register_driver(&cs4232_driver);
+		if (cs4232_devices)
+			return 0;
+	}
 
 	if(io==-1||irq==-1||dma==-1)
 	{
@@ -503,7 +507,8 @@
 	int ints[7];
 
 	/* If we have isapnp cards, no need for options */
-	if (pnp_register_driver(&cs4232_driver) > 0)
+	pnp_register_driver(&cs4232_driver);
+	if (cs4232_devices)
 		return 1;
 	
 	str = get_options(str, ARRAY_SIZE(ints), ints);

  parent reply	other threads:[~2006-03-02 23:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-02 23:01 [PATCH 0/9] PNP: " Bjorn Helgaas
2006-03-02 23:09 ` [PATCH 1/9] parport: " Bjorn Helgaas
2006-03-02 23:09 ` [PATCH 2/9] mpu401: " Bjorn Helgaas
2006-03-02 23:09 ` [PATCH 3/9] cs4236: " Bjorn Helgaas
2006-03-02 23:09 ` [PATCH 4/9] opl3sa2: " Bjorn Helgaas
2006-03-02 23:09 ` [PATCH 5/9] ns558: " Bjorn Helgaas
2006-03-03 12:55   ` Vojtech Pavlik
2006-03-03 15:58     ` Bjorn Helgaas
2006-03-02 23:09 ` [PATCH 6/9] i8042: " Bjorn Helgaas
2006-03-14  5:31   ` Dmitry Torokhov
2006-03-02 23:09 ` [PATCH 7/9] IRDA: " Bjorn Helgaas
2006-03-02 23:09 ` Bjorn Helgaas [this message]
2006-03-02 23:09 ` [PATCH 9/9] PNP: " Bjorn Helgaas
2006-03-14  6:19 ` [PATCH 0/9] " Adam Belay

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=200603021609.51563.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=perex@suse.cz \
    --cc=shaohua.li@intel.com \
    /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®