Commit aacfddfdadb3540651d263245069631f341e953a

Authored by Takashi Iwai
1 parent d28215996b

ALSA: bt87x: Make load_all parameter working again

Along with a clean up commit [e9f66d9b9: ALSA: pci: clean up using
module_pci_driver()], bt87x driver lost the functionality of load_all
parameter.  This patch does a partial revert of the commit only for
bt87x.c to recover it.

Reported-by: Clemens Ladisch <cladisch@googlemail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

Showing 1 changed file with 17 additions and 2 deletions Side-by-side Diff

... ... @@ -836,6 +836,8 @@
836 836 {0x7063, 0x2000}, /* pcHDTV HD-2000 TV */
837 837 };
838 838  
  839 +static struct pci_driver driver;
  840 +
839 841 /* return the id of the card, or a negative value if it's blacklisted */
840 842 static int snd_bt87x_detect_card(struct pci_dev *pci)
841 843 {
842 844  
... ... @@ -962,12 +964,25 @@
962 964 { }
963 965 };
964 966  
965   -static struct pci_driver bt87x_driver = {
  967 +static struct pci_driver driver = {
966 968 .name = KBUILD_MODNAME,
967 969 .id_table = snd_bt87x_ids,
968 970 .probe = snd_bt87x_probe,
969 971 .remove = snd_bt87x_remove,
970 972 };
971 973  
972   -module_pci_driver(bt87x_driver);
  974 +static int __init alsa_card_bt87x_init(void)
  975 +{
  976 + if (load_all)
  977 + driver.id_table = snd_bt87x_default_ids;
  978 + return pci_register_driver(&driver);
  979 +}
  980 +
  981 +static void __exit alsa_card_bt87x_exit(void)
  982 +{
  983 + pci_unregister_driver(&driver);
  984 +}
  985 +
  986 +module_init(alsa_card_bt87x_init)
  987 +module_exit(alsa_card_bt87x_exit)