diff mbox series

[1/2] iio: adc: stm32-dfsdm: manage the get_irq error case

Message ID 1556110286-1526-2-git-send-email-fabien.dessenne@st.com (mailing list archive)
State New, archived
Headers show
Series iio: adc: stm32-dfsdm: manage error cases in probe | expand

Commit Message

Fabien DESSENNE April 24, 2019, 12:51 p.m. UTC
During probe, check the "get_irq" error value.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
---
 drivers/iio/adc/stm32-dfsdm-adc.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Fabrice Gasnier April 24, 2019, 12:55 p.m. UTC | #1
On 4/24/19 2:51 PM, Fabien Dessenne wrote:
> During probe, check the "get_irq" error value.
> 
> Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
> ---

Hi Fabien,

Acked-by: Fabrice Gasnier <fabrice.gasnier@st.com>

Thanks,
Fabrice

>  drivers/iio/adc/stm32-dfsdm-adc.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c
> index 19adc2b..588907c 100644
> --- a/drivers/iio/adc/stm32-dfsdm-adc.c
> +++ b/drivers/iio/adc/stm32-dfsdm-adc.c
> @@ -1456,6 +1456,12 @@ static int stm32_dfsdm_adc_probe(struct platform_device *pdev)
>  	 * So IRQ associated to filter instance 0 is dedicated to the Filter 0.
>  	 */
>  	irq = platform_get_irq(pdev, 0);
> +	if (irq < 0) {
> +		if (irq != -EPROBE_DEFER)
> +			dev_err(dev, "Failed to get IRQ: %d\n", irq);
> +		return irq;
> +	}
> +
>  	ret = devm_request_irq(dev, irq, stm32_dfsdm_irq,
>  			       0, pdev->name, adc);
>  	if (ret < 0) {
>
Jonathan Cameron April 27, 2019, 1:08 p.m. UTC | #2
On Wed, 24 Apr 2019 14:55:09 +0200
Fabrice Gasnier <fabrice.gasnier@st.com> wrote:

> On 4/24/19 2:51 PM, Fabien Dessenne wrote:
> > During probe, check the "get_irq" error value.
> > 
> > Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
> > ---  
> 
> Hi Fabien,
> 
> Acked-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.

Thanks,

Jonathan

> 
> Thanks,
> Fabrice
> 
> >  drivers/iio/adc/stm32-dfsdm-adc.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c
> > index 19adc2b..588907c 100644
> > --- a/drivers/iio/adc/stm32-dfsdm-adc.c
> > +++ b/drivers/iio/adc/stm32-dfsdm-adc.c
> > @@ -1456,6 +1456,12 @@ static int stm32_dfsdm_adc_probe(struct platform_device *pdev)
> >  	 * So IRQ associated to filter instance 0 is dedicated to the Filter 0.
> >  	 */
> >  	irq = platform_get_irq(pdev, 0);
> > +	if (irq < 0) {
> > +		if (irq != -EPROBE_DEFER)
> > +			dev_err(dev, "Failed to get IRQ: %d\n", irq);
> > +		return irq;
> > +	}
> > +
> >  	ret = devm_request_irq(dev, irq, stm32_dfsdm_irq,
> >  			       0, pdev->name, adc);
> >  	if (ret < 0) {
> >
diff mbox series

Patch

diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c
index 19adc2b..588907c 100644
--- a/drivers/iio/adc/stm32-dfsdm-adc.c
+++ b/drivers/iio/adc/stm32-dfsdm-adc.c
@@ -1456,6 +1456,12 @@  static int stm32_dfsdm_adc_probe(struct platform_device *pdev)
 	 * So IRQ associated to filter instance 0 is dedicated to the Filter 0.
 	 */
 	irq = platform_get_irq(pdev, 0);
+	if (irq < 0) {
+		if (irq != -EPROBE_DEFER)
+			dev_err(dev, "Failed to get IRQ: %d\n", irq);
+		return irq;
+	}
+
 	ret = devm_request_irq(dev, irq, stm32_dfsdm_irq,
 			       0, pdev->name, adc);
 	if (ret < 0) {