summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2015-06-05 18:42:12 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-08-03 09:29:03 -0700
commitd83057a32525626d96217f0112c7197b223180fe (patch)
tree23b06d5e7927b686dfd7c848d99dac6787b95b19 /sound/soc
parentb955267c9fd99df9a4fcf1b2b570c3c1fa89d8ba (diff)
ASoC: rt5645: Init jack_detect_work before registering irq
commit 7ea3470a7277380248135a592a849e1c27960b2f upstream. Prevents frequent panic on boot, if the irq handler rt5645_irq gets called before the workqueue rt5645_jack_detect_work is initialized. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/rt5645.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index be4d741c45ba..2ee44abd56a6 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -2837,6 +2837,8 @@ static int rt5645_i2c_probe(struct i2c_client *i2c,
}
}
+ INIT_DELAYED_WORK(&rt5645->jack_detect_work, rt5645_jack_detect_work);
+
if (rt5645->i2c->irq) {
ret = request_threaded_irq(rt5645->i2c->irq, NULL, rt5645_irq,
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING
@@ -2855,8 +2857,6 @@ static int rt5645_i2c_probe(struct i2c_client *i2c,
dev_err(&i2c->dev, "Fail gpio_direction hp_det_gpio\n");
}
- INIT_DELAYED_WORK(&rt5645->jack_detect_work, rt5645_jack_detect_work);
-
return snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5645,
rt5645_dai, ARRAY_SIZE(rt5645_dai));
}