mfd: stmfx: Fix stmfx_irq_init error path

[ Upstream commit 60c2c4bcb9 ]

In case the interrupt signal can't be configured, IRQ domain needs to be
removed.

Fixes: 06252ade91 ("mfd: Add ST Multi-Function eXpander (STMFX) core driver")
Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Amelie Delaunay 2020-04-22 11:08:32 +02:00 committed by Greg Kroah-Hartman
parent cf90dd9fb1
commit d8d1b8b417
1 changed files with 7 additions and 2 deletions

View File

@ -287,14 +287,19 @@ static int stmfx_irq_init(struct i2c_client *client)
ret = regmap_write(stmfx->map, STMFX_REG_IRQ_OUT_PIN, irqoutpin);
if (ret)
return ret;
goto irq_exit;
ret = devm_request_threaded_irq(stmfx->dev, client->irq,
NULL, stmfx_irq_handler,
irqtrigger | IRQF_ONESHOT,
"stmfx", stmfx);
if (ret)
stmfx_irq_exit(client);
goto irq_exit;
return 0;
irq_exit:
stmfx_irq_exit(client);
return ret;
}