From patchwork Tue Apr 30 07:51:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13648441 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 53B5BC10F16 for ; Tue, 30 Apr 2024 07:52:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6FDqmuz8HRKJC7NDG6fTTIiQeQHYvUIdxyV+/lRHRCc=; b=CYCOvxfWfAGKSv ywR6Hx33tBp/J8NQS+B0puJWu5aBC1r9d5TMq8x94fLBPv7i+pYp6qJi8mKNNK49orDLHYfVokT20 L6FQqW0mZ7JvijeqapcVen1+M9WnQY4AURxsVz2Q274YlsS819HZI7+YO7RqDa5vemxNq4PLM3DUo oYEhgZrDdkdtcC4OT3nSo02Mc0oMVTZk7RSxmy5xGrOO1qgedK1nZyPmH6aVmBeHA0optT1Fq1hqk 1GHA8iAiGUlX5aJiDZwHzppkdZz6QdsGRalI3sKxu65iy/JxGxTDOVjCRBKXKRwi8+dopB5jl6mvN 5UAK277rX2uC4klVxMPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1iHP-00000005VOi-3rcU; Tue, 30 Apr 2024 07:51:59 +0000 Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1iH1-00000005VD9-2wUT for linux-arm-kernel@lists.infradead.org; Tue, 30 Apr 2024 07:51:38 +0000 Received: by mail-qt1-x830.google.com with SMTP id d75a77b69052e-43b0b09d012so6658401cf.3 for ; Tue, 30 Apr 2024 00:51:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714463492; x=1715068292; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=R57CjkbkLkl8A/VUwKtkzF9x/otNALa5HeVqDryNHrA=; b=keHwjGfrmN0CG0yNme3vzjDEI63r57IqOE/CucG/ILHVEdLDyu+DZPiOMrbQA+rOmS o0C5KiFBsneTI277tPIqKa2Se6pGjhIJihV7l0nIMOFfho/EfWHZwHNRNww62VGqWCiW nP7z+ARVzfhzJmQJhRv2hzvE+bCvyf19EHLXE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714463492; x=1715068292; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R57CjkbkLkl8A/VUwKtkzF9x/otNALa5HeVqDryNHrA=; b=vgQ8euXHP+BRdJa3vRXXix8dMQKgmV2osOhzk4wESlOLrnGXZhrGJXZgK9+OQGKXhP mySvLR5/n+mFQFSKNdE6XNqrsObxkG/wfNFm+g2qmLg2z5yIQMDXrKHY7/fjP+fdd9n6 0jpMbL9mvVGpsH65AP3ufHELprtYeuJc3+QwdL+0qFzEOmHETDFu+9+ZwiEoFadngB6P mqNUTdpPmkM2qaOBU207i/97JzEuyBWOF2aU0kBoFJVhoN2RFdqWqTXf7r2ZBXOjZcBf W71JtZt3ifwYsXl57JI0+vGsXgXcF4IpgC/6HkIgDWe0Oz6l8WGKdgwiMSAEdOLrH72J f/Zw== X-Forwarded-Encrypted: i=1; AJvYcCWMC2mQktE48+opHBwzcelCI88SQuVwvDx8BETUvaBAzAmTFXl9AOFJ51jBx+d7bqyXsXm5w0Dkg9/YOjE1vIhwQYO7x57h7Io5r6w8j/9Grcue/1k= X-Gm-Message-State: AOJu0YzthMxdR0H4kzo7GvANAT+LafELTQGwbBCV81M8HgRLs9rBd7gs PytCbv/AKgjNBfCWbiNmXj2PDCvZTWCOsstS+SUCj3JZ6Tja7NCS6BFNLAIFZg== X-Google-Smtp-Source: AGHT+IFox+JJPaIDfnbJPXdvKCOIVMCsX59wRzBpWnMawbJcnJD3u85NhlKUJm+Q/1EmXzvmqcrFDg== X-Received: by 2002:a05:622a:1b86:b0:43b:dd6:82c0 with SMTP id bp6-20020a05622a1b8600b0043b0dd682c0mr3500422qtb.33.1714463492092; Tue, 30 Apr 2024 00:51:32 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id z11-20020a05622a124b00b00437b4048972sm10634547qtx.18.2024.04.30.00.51.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 00:51:31 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 30 Apr 2024 07:51:26 +0000 Subject: [PATCH 1/3] media: bcm2835-unicam: Fix error handling for platform_get_irq MIME-Version: 1.0 Message-Id: <20240430-fix-broad-v1-1-cf3b81bf97ff@chromium.org> References: <20240430-fix-broad-v1-0-cf3b81bf97ff@chromium.org> In-Reply-To: <20240430-fix-broad-v1-0-cf3b81bf97ff@chromium.org> To: Mauro Carvalho Chehab , Florian Fainelli , Broadcom internal kernel review list , Ray Jui , Scott Branden Cc: linux-media@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_005135_824091_95BCA3A6 X-CRM114-Status: GOOD ( 14.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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; goto err_unicam_put; }