diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-06-08 12:10:32 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-06-08 12:10:32 -0400 |
commit | 9470195a9cd13e6d90221b8b5d897e9232da8d28 (patch) | |
tree | 12f57a49fe94310396f7108c267560c74189c0e0 /sound/pci/ctxfi/cthardware.c | |
parent | d362af62ed98f58c64a2b3dd58c79d25ad181b0b (diff) |
ALSA: ctxfi - Clean up probe routines
Clean up probe routines and model detection routines so that the driver
won't call and check the PCI subsystem id at each time.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ctxfi/cthardware.c')
-rw-r--r-- | sound/pci/ctxfi/cthardware.c | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/sound/pci/ctxfi/cthardware.c b/sound/pci/ctxfi/cthardware.c index 5ec6813d3911..8e64f4862e85 100644 --- a/sound/pci/ctxfi/cthardware.c +++ b/sound/pci/ctxfi/cthardware.c | |||
@@ -20,34 +20,16 @@ | |||
20 | #include "cthw20k2.h" | 20 | #include "cthw20k2.h" |
21 | #include <linux/bug.h> | 21 | #include <linux/bug.h> |
22 | 22 | ||
23 | static enum CHIPTYP __devinitdata get_chip_type(struct hw *hw) | 23 | int __devinit create_hw_obj(struct pci_dev *pci, enum CHIPTYP chip_type, |
24 | { | 24 | enum CTCARDS model, struct hw **rhw) |
25 | enum CHIPTYP type; | ||
26 | |||
27 | switch (hw->pci->device) { | ||
28 | case 0x0005: /* 20k1 device */ | ||
29 | type = ATC20K1; | ||
30 | break; | ||
31 | case 0x000B: /* 20k2 device */ | ||
32 | type = ATC20K2; | ||
33 | break; | ||
34 | default: | ||
35 | type = ATCNONE; | ||
36 | break; | ||
37 | } | ||
38 | |||
39 | return type; | ||
40 | } | ||
41 | |||
42 | int __devinit create_hw_obj(struct pci_dev *pci, struct hw **rhw) | ||
43 | { | 25 | { |
44 | int err; | 26 | int err; |
45 | 27 | ||
46 | switch (pci->device) { | 28 | switch (chip_type) { |
47 | case 0x0005: /* 20k1 device */ | 29 | case ATC20K1: |
48 | err = create_20k1_hw_obj(rhw); | 30 | err = create_20k1_hw_obj(rhw); |
49 | break; | 31 | break; |
50 | case 0x000B: /* 20k2 device */ | 32 | case ATC20K2: |
51 | err = create_20k2_hw_obj(rhw); | 33 | err = create_20k2_hw_obj(rhw); |
52 | break; | 34 | break; |
53 | default: | 35 | default: |
@@ -58,7 +40,8 @@ int __devinit create_hw_obj(struct pci_dev *pci, struct hw **rhw) | |||
58 | return err; | 40 | return err; |
59 | 41 | ||
60 | (*rhw)->pci = pci; | 42 | (*rhw)->pci = pci; |
61 | (*rhw)->get_chip_type = get_chip_type; | 43 | (*rhw)->chip_type = chip_type; |
44 | (*rhw)->model = model; | ||
62 | 45 | ||
63 | return 0; | 46 | return 0; |
64 | } | 47 | } |