diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-10-01 16:20:04 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-10-20 10:15:20 +0200 |
commit | b9a94a9c787d053e8d3bb7e7dff9648e723a4533 (patch) | |
tree | 5aa9dc1c591e16d5eb6a1e99d03f2d57bac5d90f /sound/pci/hda/patch_ca0110.c | |
parent | 78abb2afaf3d7635e9b1770c50e50b59820c4e5d (diff) | |
download | lwn-b9a94a9c787d053e8d3bb7e7dff9648e723a4533.tar.gz lwn-b9a94a9c787d053e8d3bb7e7dff9648e723a4533.zip |
ALSA: hda - convert to hda_device_id
Finally we have a proper infrastructure to generate the modaliases
automatically, let's move to hda_device_id from the legacy
hda_codec_preset that contains basically the same information.
The patch function hook is stored in driver_data field, which is long,
and we need an explicit cast. Other than that, the conversion is
mostly straightforward. Each entry is even simplified using a macro,
and the lengthy (and error-prone) manual modaliases got removed.
As a result, we achieved a quite good diet:
14 files changed, 407 insertions(+), 595 deletions(-)
Reviewed-by: Vinod Koul <vinod.koul@intel.com>
Tested-by: Subhransu S Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_ca0110.c')
-rw-r--r-- | sound/pci/hda/patch_ca0110.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sound/pci/hda/patch_ca0110.c b/sound/pci/hda/patch_ca0110.c index 484bbf4134cd..c2d9ee9cfdc0 100644 --- a/sound/pci/hda/patch_ca0110.c +++ b/sound/pci/hda/patch_ca0110.c @@ -83,22 +83,19 @@ static int patch_ca0110(struct hda_codec *codec) /* * patch entries */ -static const struct hda_codec_preset snd_hda_preset_ca0110[] = { - { .id = 0x1102000a, .name = "CA0110-IBG", .patch = patch_ca0110 }, - { .id = 0x1102000b, .name = "CA0110-IBG", .patch = patch_ca0110 }, - { .id = 0x1102000d, .name = "SB0880 X-Fi", .patch = patch_ca0110 }, +static const struct hda_device_id snd_hda_id_ca0110[] = { + HDA_CODEC_ENTRY(0x1102000a, "CA0110-IBG", patch_ca0110), + HDA_CODEC_ENTRY(0x1102000b, "CA0110-IBG", patch_ca0110), + HDA_CODEC_ENTRY(0x1102000d, "SB0880 X-Fi", patch_ca0110), {} /* terminator */ }; - -MODULE_ALIAS("snd-hda-codec-id:1102000a"); -MODULE_ALIAS("snd-hda-codec-id:1102000b"); -MODULE_ALIAS("snd-hda-codec-id:1102000d"); +MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_ca0110); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Creative CA0110-IBG HD-audio codec"); static struct hda_codec_driver ca0110_driver = { - .preset = snd_hda_preset_ca0110, + .id = snd_hda_id_ca0110, }; module_hda_codec_driver(ca0110_driver); |