All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mfd: mc13xxx: Add check for mc13xxx_irq_request
@ 2022-02-24  2:23 Jiasheng Jiang
  2022-03-07 14:02 ` Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Jiasheng Jiang @ 2022-02-24  2:23 UTC (permalink / raw)
  To: lee.jones; +Cc: linux-kernel, Jiasheng Jiang

As the potential failure of the devm_request_threaded_irq(),
it should be better to check the return value of the
mc13xxx_irq_request() and return error if fails.

Fixes: 8e00593557c3 ("mfd: Add mc13892 support to mc13xxx")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
---
 drivers/mfd/mc13xxx-core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c
index 8a4f1d90dcfd..1000572761a8 100644
--- a/drivers/mfd/mc13xxx-core.c
+++ b/drivers/mfd/mc13xxx-core.c
@@ -323,8 +323,10 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, unsigned int mode,
 		adc1 |= MC13783_ADC1_ATOX;
 
 	dev_dbg(mc13xxx->dev, "%s: request irq\n", __func__);
-	mc13xxx_irq_request(mc13xxx, MC13XXX_IRQ_ADCDONE,
+	ret = mc13xxx_irq_request(mc13xxx, MC13XXX_IRQ_ADCDONE,
 			mc13xxx_handler_adcdone, __func__, &adcdone_data);
+	if (ret)
+		goto out;
 
 	mc13xxx_reg_write(mc13xxx, MC13XXX_ADC0, adc0);
 	mc13xxx_reg_write(mc13xxx, MC13XXX_ADC1, adc1);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mfd: mc13xxx: Add check for mc13xxx_irq_request
  2022-02-24  2:23 [PATCH] mfd: mc13xxx: Add check for mc13xxx_irq_request Jiasheng Jiang
@ 2022-03-07 14:02 ` Lee Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2022-03-07 14:02 UTC (permalink / raw)
  To: Jiasheng Jiang; +Cc: linux-kernel

On Thu, 24 Feb 2022, Jiasheng Jiang wrote:

> As the potential failure of the devm_request_threaded_irq(),
> it should be better to check the return value of the
> mc13xxx_irq_request() and return error if fails.
> 
> Fixes: 8e00593557c3 ("mfd: Add mc13892 support to mc13xxx")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> ---
>  drivers/mfd/mc13xxx-core.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Principal Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-07 14:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-24  2:23 [PATCH] mfd: mc13xxx: Add check for mc13xxx_irq_request Jiasheng Jiang
2022-03-07 14:02 ` Lee Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.