diff options
author | Nicolas Boichat <drinkcat@chromium.org> | 2015-06-05 06:42:12 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-06-05 13:15:12 -0400 |
commit | 7ea3470a7277380248135a592a849e1c27960b2f (patch) | |
tree | eb7926b63b71fbb7143688edbb500912f68000cf | |
parent | 692768c4b28ddfc96f5ff752048826b859bd71ca (diff) |
ASoC: rt5645: Init jack_detect_work before registering irq
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>
Cc: stable@vger.kernel.org
-rw-r--r-- | sound/soc/codecs/rt5645.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index bc925f0ee668..c82301484156 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, | |||
2837 | } | 2837 | } |
2838 | } | 2838 | } |
2839 | 2839 | ||
2840 | INIT_DELAYED_WORK(&rt5645->jack_detect_work, rt5645_jack_detect_work); | ||
2841 | |||
2840 | if (rt5645->i2c->irq) { | 2842 | if (rt5645->i2c->irq) { |
2841 | ret = request_threaded_irq(rt5645->i2c->irq, NULL, rt5645_irq, | 2843 | ret = request_threaded_irq(rt5645->i2c->irq, NULL, rt5645_irq, |
2842 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | 2844 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
@@ -2855,8 +2857,6 @@ static int rt5645_i2c_probe(struct i2c_client *i2c, | |||
2855 | dev_err(&i2c->dev, "Fail gpio_direction hp_det_gpio\n"); | 2857 | dev_err(&i2c->dev, "Fail gpio_direction hp_det_gpio\n"); |
2856 | } | 2858 | } |
2857 | 2859 | ||
2858 | INIT_DELAYED_WORK(&rt5645->jack_detect_work, rt5645_jack_detect_work); | ||
2859 | |||
2860 | return snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5645, | 2860 | return snd_soc_register_codec(&i2c->dev, &soc_codec_dev_rt5645, |
2861 | rt5645_dai, ARRAY_SIZE(rt5645_dai)); | 2861 | rt5645_dai, ARRAY_SIZE(rt5645_dai)); |
2862 | } | 2862 | } |