Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp53416lqh; Mon, 6 May 2024 11:01:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV9VOkauJ9rKNvQLaFCKA/s8N9wjEoGqr72TKQIcjxw98jrlrXJCDsKYrXXVEPvFAGZzaEzW4dzDiFdYh/gcy3U1A1NE7BFQx5IY8M7zQ== X-Google-Smtp-Source: AGHT+IF0zlLV2FhreI4Vj8H23Iq4zLeHnca9H4nWUXuXbGPjYa56oxd456Vx0K/xP0QRD+VloEDZ X-Received: by 2002:a17:906:3597:b0:a55:adf5:e698 with SMTP id a640c23a62f3a-a59e4e35085mr29426066b.28.1715018459916; Mon, 06 May 2024 11:00:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715018459; cv=pass; d=google.com; s=arc-20160816; b=WOskIcc+3nuR0LyAwmIMItp3jNdeQKqHbf5kBHSGL2OQSY212JyYDdXko8LOlLTVhx 3CngiuTmspM6ZjysiH9/UUQ9K/rfSLOxTDGqDn4glmzu7x1GY/NuPeDYXm/xf4rzVM45 p6lrZhk4IaqQFTNM6K82PIxMoUm/TrrdWMP9NaDYmdiOmrVW0s6KNMxVV19utXLvQd2o URe1sCul2Ppxw3Yj3gxTG2B+DkLIfKWDYXqng0Xq32KRT7t02fDwr7utwB8SmWlprXrD cdO+WeeqbNpsc2m8QOVFYEEW3Fof8/nFmxrmo6pqIdY4zFK4a/rWxBxkRzPTNAYReS2+ w4Wg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=IBDA/6t/FLW68UB7k/FfBbjUftHy9RN9Qee8rHYiMeA=; fh=aI7HXplajwh9PHGog/YD/WLsw0Yjp3/63MYIgCPOFoc=; b=VyxwSGHqt89AlcU/zaDzWJCwGJLe+5w0kq4WM8OLd6gq9QeR/GBAdCG9c/Io1DTo3u CADNrBmL39fAlrUOkrlGgRvdfqg+7Ewlnw7qqLLPsrmfdYTVjzpxGAaUHjrWpsJzh44a rt9XTrTvJXOvt2zFIs5tp0SMwpsVcQt7NCzRx+R+lKSDzr9Y/Ro6O5M7W8PDmke1giBU e/zPEsVpiRXssxcJCHrjYWFA+Xisrh5f1GUUo2pvUtXJd59Ed7VXJkrDAZZpyPC4pc2F iNKAQZZvhgucqcE5epHIv7w64IFBUp3CFGlqhbZdhAiOOdXmcxLNyZJdvbHc6LfopEYw UqAQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=DMGWyMjn; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-170262-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170262-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id oz40-20020a1709077da800b00a59c33700f5si2092311ejc.509.2024.05.06.11.00.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 11:00:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170262-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=DMGWyMjn; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-170262-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170262-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A34AD1F211F0 for ; Mon, 6 May 2024 18:00:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B9F1E158D69; Mon, 6 May 2024 18:00:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="DMGWyMjn" Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C6F5158862; Mon, 6 May 2024 18:00:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715018430; cv=none; b=jR1CkLqriPxsH08SDkXlXr6MQR0hj9kdNm5/1ZCDzkSDFLg5j6Xd6knuH5RIrTlkDWtNZIDRj0dZe7NQoDK3slJGYT4t/pQfpFnVizpmGtVnZh9utNezDR5FCaJuFAf6+f4lbV2bKQzf7wZdvZACx6O5WQlkNfxrfuhTjXYuV8w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715018430; c=relaxed/simple; bh=XZbRa2/CC1i0OKL/XxQNlvYNIDcAl0wDNwFniFr7p6A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UPMTvvzEtSFTUT9FF9MfWtUjbmivzcAFHmEddOq2N2O3hwnPfu8BindqSIyMPRRBEZmaFgcQ6/1oAIaCLJASXblq75qA4CyMk2SJGI7g6h8u533nb54EDqAAiH9qmCq3zjL6ahUvgZtjFm2dSfxiBchDEb+z9ha0LiAdVPuUShI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=DMGWyMjn; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2C3EFA98; Mon, 6 May 2024 20:00:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1715018426; bh=XZbRa2/CC1i0OKL/XxQNlvYNIDcAl0wDNwFniFr7p6A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DMGWyMjnHOPYAoGyNs7FCC+QI5qcN8NyDeAOnlwB6r5VDo2Ulc0F1EkabeKNeEFeA 7Pk4KzfSABahfKGfVGOx6hr4Os2GIgtntgNHuOJxzXr5R1TBG8BCYcKUxXVhuCjtFX 3H+U+79SGCp/JVK84t1Q+0FwwuZqSIAwjcQIcyX0= Date: Mon, 6 May 2024 21:00:19 +0300 From: Laurent Pinchart To: Ricardo Ribalda Cc: Mauro Carvalho Chehab , Florian Fainelli , Broadcom internal kernel review list , Ray Jui , Scott Branden , linux-media@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Hans Verkuil Subject: Re: [PATCH 1/3] media: bcm2835-unicam: Fix error handling for platform_get_irq Message-ID: <20240506180019.GE29108@pendragon.ideasonboard.com> References: <20240430-fix-broad-v1-0-cf3b81bf97ff@chromium.org> <20240430-fix-broad-v1-1-cf3b81bf97ff@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240430-fix-broad-v1-1-cf3b81bf97ff@chromium.org> Hi Ricardo, Thank you for the patch. On Tue, Apr 30, 2024 at 07:51:26AM +0000, Ricardo Ribalda wrote: > platform_get_irq() cannot return the value 0. > > If it returns -EPROBE_DEFER, we need to populate the error code upwards > to retry probing once the irq handler is ready. > > Signed-off-by: Ricardo Ribalda > --- > drivers/media/platform/broadcom/bcm2835-unicam.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/platform/broadcom/bcm2835-unicam.c b/drivers/media/platform/broadcom/bcm2835-unicam.c > index bd2bbb53070e..2a3a27ac70ba 100644 > --- a/drivers/media/platform/broadcom/bcm2835-unicam.c > +++ b/drivers/media/platform/broadcom/bcm2835-unicam.c > @@ -2660,9 +2660,10 @@ static int unicam_probe(struct platform_device *pdev) > } > > ret = platform_get_irq(pdev, 0); > - if (ret <= 0) { > + if (ret < 0) { > dev_err(&pdev->dev, "No IRQ resource\n"); > - ret = -EINVAL; > + if (ret != -EPROBE_DEFER) > + ret = -EINVAL; What's wrong with leaving ret untouched ? I assume it was set to -EINVAL to avoid returning success in case ret was 0. Now that the test has changed, I think we can leave the value as-is. > goto err_unicam_put; > } > > -- Regards, Laurent Pinchart