[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190531093132.GB23111@amd>
Date: Fri, 31 May 2019 11:31:32 +0200
From: Pavel Machek <pavel@...x.de>
To: Fabien DESSENNE <fabien.dessenne@...com>
Cc: Pavel Machek <pavel@...x.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"stable@...r.kernel.org" <stable@...r.kernel.org>,
Hugues FRUCHET <hugues.fruchet@...com>,
Hans Verkuil <hverkuil-cisco@...all.nl>,
Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 4.19 070/276] media: stm32-dcmi: return appropriate error
codes during probe
On Fri 2019-05-31 08:39:18, Fabien DESSENNE wrote:
> Hi Pavel
>
>
> On 31/05/2019 10:19 AM, Pavel Machek wrote:
> > Hi!
> >
> >> [ Upstream commit b5b5a27bee5884860798ffd0f08e611a3942064b ]
> >>
> >> During probe, return the provided errors value instead of -ENODEV.
> >> This allows the driver to be deferred probed if needed.
> > This is not correct AFAICT.
>
>
> The driver gets defer probed *if needed*. *if needed* is for the case
> where platform_get_irq returns -EPROBE_DEFER, which happens if the irq
> controller is not ready yet.
>
> Of course, for the other cases, the probe would just fail.
"This" was referring to code below. Sorry for confusion.
Best regards,
Pavel
> >> +++ b/drivers/media/platform/stm32/stm32-dcmi.c
> >> @@ -1673,8 +1673,9 @@ static int dcmi_probe(struct platform_device *pdev)
> >>
> >> irq = platform_get_irq(pdev, 0);
> >> if (irq <= 0) {
> >> - dev_err(&pdev->dev, "Could not get irq\n");
> >> - return -ENODEV;
> >> + if (irq != -EPROBE_DEFER)
> >> + dev_err(&pdev->dev, "Could not get irq\n");
> >> + return irq;
> >> }
> >>
> >> dcmi->res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > irq == 0 is clearly means error here, but will be interpretted as
> > success when returned to the caller.
>
>
> Thank you for pointing this.
>
> It shall be 'return irq ? irq : -ENXIO;' I will send a fix for this.
>
>
> >
> > As device is not initialized at that point, I'd expect some kind of
> > crash later.
> > Pavel
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists