mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
ASoC: codecs: wcd937x: request watchdog IRQs without devm
The watchdog IRQs are requested from the codec component probe and released
from its remove callback. Use the same non-devm lifetime for both
operations.
Use request_threaded_irq() and keep free_irq() in the component remove
callback. Return errors from each request and unwind only IRQs that were
successfully requested, including failures later in component probe.
Fixes: 9be3ec196d ("ASoC: codecs: wcd937x: add wcd937x codec driver")
Assisted-by: LLM
Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
Link: https://patch.msgid.link/20261004102346.1203410-1-runyu.xiao@seu.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
e913917feb
commit
b3f17433a1
|
|
@ -2536,23 +2536,23 @@ static int wcd937x_soc_codec_probe(struct snd_soc_component *component)
|
|||
WCD937X_IRQ_AUX_PDM_WD_INT);
|
||||
|
||||
/* Request for watchdog interrupt */
|
||||
ret = devm_request_threaded_irq(dev, wcd937x->hphr_pdm_wd_int, NULL, wcd937x_wd_handle_irq,
|
||||
IRQF_ONESHOT | IRQF_TRIGGER_RISING,
|
||||
"HPHR PDM WDOG INT", wcd937x);
|
||||
ret = request_threaded_irq(wcd937x->hphr_pdm_wd_int, NULL, wcd937x_wd_handle_irq,
|
||||
IRQF_ONESHOT | IRQF_TRIGGER_RISING,
|
||||
"HPHR PDM WDOG INT", wcd937x);
|
||||
if (ret)
|
||||
dev_err(dev, "Failed to request HPHR watchdog interrupt (%d)\n", ret);
|
||||
goto err_free_clsh;
|
||||
|
||||
ret = devm_request_threaded_irq(dev, wcd937x->hphl_pdm_wd_int, NULL, wcd937x_wd_handle_irq,
|
||||
IRQF_ONESHOT | IRQF_TRIGGER_RISING,
|
||||
"HPHL PDM WDOG INT", wcd937x);
|
||||
ret = request_threaded_irq(wcd937x->hphl_pdm_wd_int, NULL, wcd937x_wd_handle_irq,
|
||||
IRQF_ONESHOT | IRQF_TRIGGER_RISING,
|
||||
"HPHL PDM WDOG INT", wcd937x);
|
||||
if (ret)
|
||||
dev_err(dev, "Failed to request HPHL watchdog interrupt (%d)\n", ret);
|
||||
goto err_free_hphr_irq;
|
||||
|
||||
ret = devm_request_threaded_irq(dev, wcd937x->aux_pdm_wd_int, NULL, wcd937x_wd_handle_irq,
|
||||
IRQF_ONESHOT | IRQF_TRIGGER_RISING,
|
||||
"AUX PDM WDOG INT", wcd937x);
|
||||
ret = request_threaded_irq(wcd937x->aux_pdm_wd_int, NULL, wcd937x_wd_handle_irq,
|
||||
IRQF_ONESHOT | IRQF_TRIGGER_RISING,
|
||||
"AUX PDM WDOG INT", wcd937x);
|
||||
if (ret)
|
||||
dev_err(dev, "Failed to request Aux watchdog interrupt (%d)\n", ret);
|
||||
goto err_free_hphl_irq;
|
||||
|
||||
/* Disable watchdog interrupt for HPH and AUX */
|
||||
disable_irq_nosync(wcd937x->hphr_pdm_wd_int);
|
||||
|
|
@ -2564,24 +2564,34 @@ static int wcd937x_soc_codec_probe(struct snd_soc_component *component)
|
|||
ARRAY_SIZE(wcd9375_dapm_widgets));
|
||||
if (ret < 0) {
|
||||
dev_err(component->dev, "Failed to add snd_ctls\n");
|
||||
wcd_clsh_ctrl_free(wcd937x->clsh_info);
|
||||
return ret;
|
||||
goto err_free_irqs;
|
||||
}
|
||||
|
||||
ret = snd_soc_dapm_add_routes(dapm, wcd9375_audio_map,
|
||||
ARRAY_SIZE(wcd9375_audio_map));
|
||||
if (ret < 0) {
|
||||
dev_err(component->dev, "Failed to add routes\n");
|
||||
wcd_clsh_ctrl_free(wcd937x->clsh_info);
|
||||
return ret;
|
||||
goto err_free_irqs;
|
||||
}
|
||||
}
|
||||
|
||||
ret = wcd937x_mbhc_init(component);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
dev_err(component->dev, "mbhc initialization failed\n");
|
||||
goto err_free_irqs;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
err_free_irqs:
|
||||
free_irq(wcd937x->aux_pdm_wd_int, wcd937x);
|
||||
err_free_hphl_irq:
|
||||
free_irq(wcd937x->hphl_pdm_wd_int, wcd937x);
|
||||
err_free_hphr_irq:
|
||||
free_irq(wcd937x->hphr_pdm_wd_int, wcd937x);
|
||||
err_free_clsh:
|
||||
wcd_clsh_ctrl_free(wcd937x->clsh_info);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void wcd937x_soc_codec_remove(struct snd_soc_component *component)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user