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>,
George Talusan <gstalusan@uwaterloo.ca>,
Takashi Iwai <tiwai@suse.de>
Subject: [PATCH 4/12] PNP: adjust pnp_register_card_driver() signature
Date: Wed, 22 Mar 2006 15:12:28 -0700 [thread overview]
Message-ID: <200603221512.28528.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. And fix some __init/__devinit issues.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Index: work-mm6/sound/isa/cmi8330.c
===================================================================
--- work-mm6.orig/sound/isa/cmi8330.c 2006-03-22 11:24:42.000000000 -0700
+++ work-mm6/sound/isa/cmi8330.c 2006-03-22 12:01:20.000000000 -0700
@@ -175,7 +175,7 @@
#endif
-static struct ad1848_mix_elem snd_cmi8330_controls[] __initdata = {
+static struct ad1848_mix_elem snd_cmi8330_controls[] __devinitdata = {
AD1848_DOUBLE("Master Playback Volume", 0, CMI8330_MASTVOL, CMI8330_MASTVOL, 4, 0, 15, 0),
AD1848_SINGLE("Loud Playback Switch", 0, CMI8330_MUTEMUX, 6, 1, 1),
AD1848_DOUBLE("PCM Playback Switch", 0, AD1848_LEFT_OUTPUT, AD1848_RIGHT_OUTPUT, 7, 7, 1, 1),
@@ -204,7 +204,7 @@
};
#ifdef ENABLE_SB_MIXER
-static struct sbmix_elem cmi8330_sb_mixers[] __initdata = {
+static struct sbmix_elem cmi8330_sb_mixers[] __devinitdata = {
SB_DOUBLE("SB Master Playback Volume", SB_DSP4_MASTER_DEV, (SB_DSP4_MASTER_DEV + 1), 3, 3, 31),
SB_DOUBLE("Tone Control - Bass", SB_DSP4_BASS_DEV, (SB_DSP4_BASS_DEV + 1), 4, 4, 15),
SB_DOUBLE("Tone Control - Treble", SB_DSP4_TREBLE_DEV, (SB_DSP4_TREBLE_DEV + 1), 4, 4, 15),
@@ -222,7 +222,7 @@
SB_SINGLE("SB Mic Auto Gain", SB_DSP4_MIC_AGC, 0, 1),
};
-static unsigned char cmi8330_sb_init_values[][2] __initdata = {
+static unsigned char cmi8330_sb_init_values[][2] __devinitdata = {
{ SB_DSP4_MASTER_DEV + 0, 0 },
{ SB_DSP4_MASTER_DEV + 1, 0 },
{ SB_DSP4_PCM_DEV + 0, 0 },
@@ -545,7 +545,7 @@
return snd_card_register(card);
}
-static int __init snd_cmi8330_nonpnp_probe(struct platform_device *pdev)
+static int __devinit snd_cmi8330_nonpnp_probe(struct platform_device *pdev)
{
struct snd_card *card;
int err;
@@ -607,6 +607,8 @@
#ifdef CONFIG_PNP
+static unsigned int __devinitdata cmi8330_pnp_devices;
+
static int __devinit snd_cmi8330_pnp_detect(struct pnp_card_link *pcard,
const struct pnp_card_device_id *pid)
{
@@ -636,6 +638,7 @@
}
pnp_set_card_drvdata(pcard, card);
dev++;
+ cmi8330_pnp_devices++;
return 0;
}
@@ -706,9 +709,9 @@
#ifdef CONFIG_PNP
err = pnp_register_card_driver(&cmi8330_pnpc_driver);
- if (err >= 0) {
+ if (!err) {
pnp_registered = 1;
- cards += err;
+ cards += cmi8330_pnp_devices;
}
#endif
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 ` [PATCH 1/12] " Bjorn Helgaas
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 ` Bjorn Helgaas [this message]
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.28528.bjorn.helgaas@hp.com \
--to=bjorn.helgaas@hp.com \
--cc=akpm@osdl.org \
--cc=ambx1@neo.rr.com \
--cc=castet.matthieu@free.fr \
--cc=gstalusan@uwaterloo.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@suse.cz \
--cc=shaohua.li@intel.com \
--cc=tiwai@suse.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®