diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2006-03-27 04:17:05 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-27 11:44:53 -0500 |
commit | 8c59c4a2216583cf79eaaaf71ef1dd5757e12854 (patch) | |
tree | 56618d818f232399ba7a682af36301fdd14b232e /sound/isa/opl3sa2.c | |
parent | ed7cb1913168fdce6d084f2f5cd6818851313383 (diff) |
[PATCH] pnp: opl3sa2: adjust pnp_register_driver signature
Remove the assumption that pnp_register_driver() returns the number of devices
claimed.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Adam Belay <ambx1@neo.rr.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'sound/isa/opl3sa2.c')
-rw-r--r-- | sound/isa/opl3sa2.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c index 56fcd8a946a4..c906e205d7d5 100644 --- a/sound/isa/opl3sa2.c +++ b/sound/isa/opl3sa2.c | |||
@@ -95,6 +95,7 @@ static struct platform_device *platform_devices[SNDRV_CARDS]; | |||
95 | static int pnp_registered; | 95 | static int pnp_registered; |
96 | static int pnpc_registered; | 96 | static int pnpc_registered; |
97 | #endif | 97 | #endif |
98 | static unsigned int snd_opl3sa2_devices; | ||
98 | 99 | ||
99 | /* control ports */ | 100 | /* control ports */ |
100 | #define OPL3SA2_PM_CTRL 0x01 | 101 | #define OPL3SA2_PM_CTRL 0x01 |
@@ -760,6 +761,7 @@ static int __devinit snd_opl3sa2_pnp_detect(struct pnp_dev *pdev, | |||
760 | } | 761 | } |
761 | pnp_set_drvdata(pdev, card); | 762 | pnp_set_drvdata(pdev, card); |
762 | dev++; | 763 | dev++; |
764 | snd_opl3sa2_devices++; | ||
763 | return 0; | 765 | return 0; |
764 | } | 766 | } |
765 | 767 | ||
@@ -826,6 +828,7 @@ static int __devinit snd_opl3sa2_pnp_cdetect(struct pnp_card_link *pcard, | |||
826 | } | 828 | } |
827 | pnp_set_card_drvdata(pcard, card); | 829 | pnp_set_card_drvdata(pcard, card); |
828 | dev++; | 830 | dev++; |
831 | snd_opl3sa2_devices++; | ||
829 | return 0; | 832 | return 0; |
830 | } | 833 | } |
831 | 834 | ||
@@ -944,7 +947,7 @@ static void __init_or_module snd_opl3sa2_unregister_all(void) | |||
944 | 947 | ||
945 | static int __init alsa_card_opl3sa2_init(void) | 948 | static int __init alsa_card_opl3sa2_init(void) |
946 | { | 949 | { |
947 | int i, err, cards = 0; | 950 | int i, err; |
948 | 951 | ||
949 | if ((err = platform_driver_register(&snd_opl3sa2_nonpnp_driver)) < 0) | 952 | if ((err = platform_driver_register(&snd_opl3sa2_nonpnp_driver)) < 0) |
950 | return err; | 953 | return err; |
@@ -964,23 +967,19 @@ static int __init alsa_card_opl3sa2_init(void) | |||
964 | goto errout; | 967 | goto errout; |
965 | } | 968 | } |
966 | platform_devices[i] = device; | 969 | platform_devices[i] = device; |
967 | cards++; | 970 | snd_opl3sa2_devices++; |
968 | } | 971 | } |
969 | 972 | ||
970 | #ifdef CONFIG_PNP | 973 | #ifdef CONFIG_PNP |
971 | err = pnp_register_driver(&opl3sa2_pnp_driver); | 974 | err = pnp_register_driver(&opl3sa2_pnp_driver); |
972 | if (err >= 0) { | 975 | if (!err) |
973 | pnp_registered = 1; | 976 | pnp_registered = 1; |
974 | cards += err; | ||
975 | } | ||
976 | err = pnp_register_card_driver(&opl3sa2_pnpc_driver); | 977 | err = pnp_register_card_driver(&opl3sa2_pnpc_driver); |
977 | if (err >= 0) { | 978 | if (!err) |
978 | pnpc_registered = 1; | 979 | pnpc_registered = 1; |
979 | cards += err; | ||
980 | } | ||
981 | #endif | 980 | #endif |
982 | 981 | ||
983 | if (!cards) { | 982 | if (!snd_opl3sa2_devices) { |
984 | #ifdef MODULE | 983 | #ifdef MODULE |
985 | snd_printk(KERN_ERR "Yamaha OPL3-SA soundcard not found or device busy\n"); | 984 | snd_printk(KERN_ERR "Yamaha OPL3-SA soundcard not found or device busy\n"); |
986 | #endif | 985 | #endif |