From: Takashi Iwai <tiwai@suse.de>
Date: Sun, 17 Sep 2006 20:00:51 +0000 (+0200)
Subject: [ALSA] powermac - Fix Oops when conflicting with aoa driver
X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=783eaf4671a4f5a95102aedb5a45e1f8adab945c;p=linux.git

[ALSA] powermac - Fix Oops when conflicting with aoa driver

Fixed Oops when conflictin with aoa driver due to lack of
i2c initialization.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
---

diff --git a/sound/ppc/keywest.c b/sound/ppc/keywest.c
index 59482a4cd4464..272ae38e9b188 100644
--- a/sound/ppc/keywest.c
+++ b/sound/ppc/keywest.c
@@ -117,6 +117,9 @@ int __init snd_pmac_tumbler_post_init(void)
 {
 	int err;
 	
+	if (!keywest_ctx || !keywest_ctx->client)
+		return -ENXIO;
+
 	if ((err = keywest_ctx->init_client(keywest_ctx)) < 0) {
 		snd_printk(KERN_ERR "tumbler: %i :cannot initialize the MCS\n", err);
 		return err;