Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp291988ybi; Fri, 31 May 2019 01:21:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAb63Rg46dz0T3UPmXyxGL3suwXehmHM4DPFIeN15dbpV99rXJZqrzEDNXu60ELknAPUe2 X-Received: by 2002:a17:90a:b393:: with SMTP id e19mr7676407pjr.91.1559290903290; Fri, 31 May 2019 01:21:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559290903; cv=none; d=google.com; s=arc-20160816; b=TCyBzCbyW/mOt9L+Yyi1rAcNd9cJ8oJVHWHmRp/hN5kJc+vqN6Fj29QuQCSbGZIuCH r1KWslDxwSLRJI+reeAFT0U5GT5iHROosNbx6FJKU4W77nvy5mHbVfXiih2vkyggyd61 9XewNg7+SXeJvmhXVumqqWAflZWmCZClO1H5Bo1sqPC4NpqC+XMXccgyVuSHsazyY6tY MgRUrjnCM9Abhg5DHtQdOYadZ8kkVc5I3+LMxxFufnQQ9HIouLaqtV2Mzvu8IEBKxDK0 cddNtwqCwB9OKxuTuurbsC7KaKHST5upwDivobAZ0f8XK/c1vDzabIoI9pi5yFAt2R1y XP8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=qOF1FZzk7AIFqyxSB3ZOqH1blB0P5EmEcEjt+tnCgzk=; b=Fm0mBaGmgUm/J4gbqAWNxqeY9iPbROMCH9fGWxGksp5lEW7Ho/4H4kIEH+RJi+tIKM cPFVotUXAECXBilLLuIH7KOVSQn+0KNmze2zB87RQ8GBDbj1Ie4J41ys0PZ2N2NcBz5g LhBhLmzIQNdKHSsTyEs0ttFOP2San4ySPyLmrEnU7pXafBRAbV/aKU22u28JuohkuAVE CKIVGA1C0mPpZk6T2jBFKxp3R9GHrI4SXN9EG4OqAuUbujDWRpdq3DQdHjArJ4gDskq5 UdNOHlaEN4JuRyBitOmUMWy3OZ5OdvFcxaokGMGX7Ts0FMSN9cNlc0WMXZQzmiInKcwH 7YQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 31si5853655plz.290.2019.05.31.01.21.27; Fri, 31 May 2019 01:21:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726984AbfEaIT2 (ORCPT + 99 others); Fri, 31 May 2019 04:19:28 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:49418 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726792AbfEaIT2 (ORCPT ); Fri, 31 May 2019 04:19:28 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 4AC6C80337; Fri, 31 May 2019 10:19:15 +0200 (CEST) Date: Fri, 31 May 2019 10:19:24 +0200 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Fabien Dessenne , Hugues Fruchet , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: Re: [PATCH 4.19 070/276] media: stm32-dcmi: return appropriate error codes during probe Message-ID: <20190531081924.GA19447@amd> References: <20190530030523.133519668@linuxfoundation.org> <20190530030530.607146114@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PNTmBPCT7hxwcZjr" Content-Disposition: inline In-Reply-To: <20190530030530.607146114@linuxfoundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --PNTmBPCT7hxwcZjr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > [ Upstream commit b5b5a27bee5884860798ffd0f08e611a3942064b ] >=20 > 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. > --- a/drivers/media/platform/stm32/stm32-dcmi.c > +++ b/drivers/media/platform/stm32/stm32-dcmi.c > @@ -1673,8 +1673,9 @@ static int dcmi_probe(struct platform_device *pdev) > =20 > irq =3D platform_get_irq(pdev, 0); > if (irq <=3D 0) { > - dev_err(&pdev->dev, "Could not get irq\n"); > - return -ENODEV; > + if (irq !=3D -EPROBE_DEFER) > + dev_err(&pdev->dev, "Could not get irq\n"); > + return irq; > } > =20 > dcmi->res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); irq =3D=3D 0 is clearly means error here, but will be interpretted as success when returned to the caller. As device is not initialized at that point, I'd expect some kind of crash later. Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --PNTmBPCT7hxwcZjr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlzw44wACgkQMOfwapXb+vLDOwCeNYqfWuF93hTtnqrgIlbrnaEN 32cAnirXKL4nHTPzW92LREyXxKlUqgAq =i5R3 -----END PGP SIGNATURE----- --PNTmBPCT7hxwcZjr--