From eb880f7c9a3cf7c6ce440c662c84449840e0b64b Mon Sep 17 00:00:00 2001 From: Marcel Ziswiler Date: Thu, 14 Mar 2013 10:41:29 +0100 Subject: apalis_t30: Realtek HDA hack Hack for Realtek HDA driver not to crash due to PCI structure not being initialised as expected. --- sound/pci/hda/patch_realtek.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'sound') diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index cb4d30305059..80a520b1ff4b 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -1188,7 +1188,10 @@ static int alc_auto_parse_customize_define(struct hda_codec *codec) } ass = codec->subsystem_id & 0xffff; +#ifndef CONFIG_MACH_APALIS_T30 +/* Hack: avoid crash due to codec->bus->pci being NULL */ if (ass != codec->bus->pci->subsystem_device && (ass & 1)) +#endif goto do_sku; nid = 0x1d; @@ -1268,7 +1271,10 @@ static int alc_subsystem_id(struct hda_codec *codec, } ass = codec->subsystem_id & 0xffff; +#ifndef CONFIG_MACH_APALIS_T30 +/* Hack: avoid crash due to codec->bus->pci being NULL */ if ((ass != codec->bus->pci->subsystem_device) && (ass & 1)) +#endif goto do_sku; /* invalid SSID, check the special NID pin defcfg instead */ @@ -1503,7 +1509,12 @@ static void alc_pick_fixup(struct hda_codec *codec, } } if (id < 0) { +#ifdef CONFIG_MACH_APALIS_T30 +/* Hack: avoid crash due to codec->bus->pci being NULL */ + quirk = NULL; +#else quirk = snd_pci_quirk_lookup(codec->bus->pci, quirk); +#endif if (quirk) { id = quirk->value; #ifdef CONFIG_SND_DEBUG_VERBOSE -- cgit v1.2.3