From patchwork Mon May 6 19:24:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13655924 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 BDB93C25B5C for ; Mon, 6 May 2024 19:25:06 +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=Du4j/ydSQ5MEJ8Qzcl7L9/QO6gaFUs4e1v3RCsuuJ6c=; b=3nEWDAT8/wSUBp 6L9uxDgi/IllnsMhxvjtcIiY9/z/F5QHtt9D0OiX+A+WHtrxxnklOzp7AgDx3tJ5Z6UP8F9g/EH1K jqEndTkf15kJLfjSwvh7nLAI2g4L41tZCl6zXLi4wmuBx7oNDfDDb9sGOKAHhM6sYGP30BcbDGTG8 q4UyvL2y/pqX0TtqhSiRG2bBCqS53oStB1ese3dZQyu0byr9IiYLgZFk8IfucpDXAm1Wy+xYCt/8n 1rZ0GI0CRmV6WwhqGR/LpLITSGBHQTOGzwkAgg6DfOyHp9+6OzUyyCBI5QY0bFxvdp6IjS6LKb6KT 3X/M3ShtVGLrib9aA5+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s43xH-00000008VT6-3iJJ; Mon, 06 May 2024 19:24:55 +0000 Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s43xC-00000008VPN-33Hc for linux-arm-kernel@lists.infradead.org; Mon, 06 May 2024 19:24:53 +0000 Received: by mail-qt1-x82b.google.com with SMTP id d75a77b69052e-43d2b4d4d3eso6530131cf.2 for ; Mon, 06 May 2024 12:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715023488; x=1715628288; 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=sERH3AW/jfrsCIvECuFC7tcnEgKRlBvngV0r54MZywU=; b=oTzC1AlkL1fTWrGq+Nk4h4eA8Kg5a1Yru5m22haOjSSu8e9Qp8EYpX2IZmoUKUravI 91H5V7KmAYudO42MLIuLDMIuyaLy42iMrFYyFaNQqyEtbftAh4BFG7cYOgkWM7JO/xNV XQIhveFMZO+KWTF16P101N0cRre8ayZtJjpNE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715023488; x=1715628288; 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=sERH3AW/jfrsCIvECuFC7tcnEgKRlBvngV0r54MZywU=; b=d+5hhjmm9FG+CrYeMDF0sWQ1p20LuvHT/78wG34ohWXfIX7UaG8eux6LeHaOOmjVJB JxuozhGtX59qZkzvQfdQYxLEIEJUNXQr1Sgvll01wRzpsOXVmezONE7O9TW0inz/khrO kcmIayrdLdlXMnms/I3gu3esd9NLUEGYsgZjhbUWr6qdZsHMAXJvfSQ+66OzTWan+H1T hNtWY0VS5CON2xR9JUbxRSbRufFYkRzcOod9zCVQgIfOq/0J7Ei+HV6LzqM+rUvCmSnB 4s5HTwoocJMtXGlJjifB0g5baTU4WQrJTOpqiDLnBqc4yoGHVgtG4h23WBcwZu2E4+d0 z3Gg== X-Forwarded-Encrypted: i=1; AJvYcCW/hAkR8Zhj9uV4V+x7FGllHYOzEI9uSeEPe07sL/XG1YRgmS9SXlUWvvUehZrI9uivV2AHkjSeIbD29ZLgmmeHNjr1gh9QB61c0yqK1HeE9FzYd90= X-Gm-Message-State: AOJu0Yy0jDudyR8NVv8L2nUMUgHZW6Kb59GhY0BY1BCRjNE9p3K8aL2+ R6U+B+33z7a9HFF/0CkuHLFE7Um2/29yMIK8abv7tidokAUFKTc7NWtoURFwFA== X-Google-Smtp-Source: AGHT+IE7wQrVOaXIB6u6ahbWEXnIqKIxesTWerqc3J7ZVDikE6i1K0SYZJY5aGJnqDPOw+uBmngdig== X-Received: by 2002:ac8:7fc2:0:b0:43a:e5b2:8627 with SMTP id b2-20020ac87fc2000000b0043ae5b28627mr13527239qtk.62.1715023488343; Mon, 06 May 2024 12:24:48 -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 ch9-20020a05622a40c900b00436e193f408sm5439870qtb.28.2024.05.06.12.24.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 12:24:48 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 06 May 2024 19:24:46 +0000 Subject: [PATCH v2 1/2] media: bcm2835-unicam: Do not replace IRQ retcode during probe MIME-Version: 1.0 Message-Id: <20240506-fix-broad-v2-1-e6a2a5c0d609@chromium.org> References: <20240506-fix-broad-v2-0-e6a2a5c0d609@chromium.org> In-Reply-To: <20240506-fix-broad-v2-0-e6a2a5c0d609@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-20240506_122450_827832_D7290EC3 X-CRM114-Status: GOOD ( 14.94 ) 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. It will either return a non-zero irq or a errcode. If a errcode is returned, we need to populate the error code upwards. It will give a more accurate reason of why it failed to the caller, who might decide to retry later. Signed-off-by: Ricardo Ribalda Reviewed-by: Laurent Pinchart --- drivers/media/platform/broadcom/bcm2835-unicam.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/media/platform/broadcom/bcm2835-unicam.c b/drivers/media/platform/broadcom/bcm2835-unicam.c index bd2bbb53070e..60c0fe956c58 100644 --- a/drivers/media/platform/broadcom/bcm2835-unicam.c +++ b/drivers/media/platform/broadcom/bcm2835-unicam.c @@ -2660,9 +2660,8 @@ 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; goto err_unicam_put; } @@ -2670,7 +2669,6 @@ static int unicam_probe(struct platform_device *pdev) "unicam_capture0", unicam); if (ret) { dev_err(&pdev->dev, "Unable to request interrupt\n"); - ret = -EINVAL; goto err_unicam_put; } From patchwork Mon May 6 19:24:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13655925 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 44AB2C25B4F for ; Mon, 6 May 2024 19:25: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=5uWGz437CJ4lKmr/8HdIJk4D795cMXu2hr1fhPxP9NI=; b=gLLrkHR38xuHJN r4Lly48gedlqMaPzRepfHqJbqr//QbjTp5VHYJwbd0KgPVg01wpHhDu6W6IWm2k/h7LwiTu9sInhK sSXmHV9n586sfh6I0FVJew7gcVPak864kCtbbjjasB0Uczzgpx36Ko6cQ5uSc7aJYMtFb+uafCQpP rS5QVvn5SwmXGawUJTgZov02plo/nigaPY0GFlVYume5snflAr9lKGDE25qgy40PPZr7JrlBtFw85 WR1e1crcB0tqQYUCFt1FxXAp2pIS9vEMh5WuhGzvfoq0VeX7DSasDaDouGOZL0lr9aVykW8lYs6Fl Y2bSoGrU/8zLJL8AfxLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s43xN-00000008VWH-3DXN; Mon, 06 May 2024 19:25:01 +0000 Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s43xG-00000008VPU-1oWl for linux-arm-kernel@lists.infradead.org; Mon, 06 May 2024 19:24:56 +0000 Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-3c97a4857a8so68504b6e.2 for ; Mon, 06 May 2024 12:24:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715023490; x=1715628290; 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=raDFNcDQUrEtJLVjBh+B3qIrZSUwTfQ8a/Tp6m6/klY=; b=nGUHM5+WZXG9tNipUg1TAggKICJX1P/LHANE9UmdSDaTVz+I69mzyxmiseWT0szWca 7ImPnheDgFDll+qRX9tXj8dKKVlGqSvd27KbQU9D7RUBhe4OsSalhzLxBNdJ0Dtgayey 9kPWcf/dljkaZCjy+XhjqCuOZxwH2lNyrg2Hg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715023490; x=1715628290; 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=raDFNcDQUrEtJLVjBh+B3qIrZSUwTfQ8a/Tp6m6/klY=; b=o6XDBIt2KIeaneMIb3vdVaIFKf+I1KDSlNEPz5siCGZdKMmOs8cx0gNdqN4rpTO8Pf KIR5RltwJF0qF445RKv6USl2wiKinpWSlU+hSPY5ec/fAhN6TyfprRtsek5OTyF5+doP XEgtjqz4+PysZHLXf1QuOzFVgnfqrZxvd4yg1ZHr/lOiQaRZRxt/mIX9VaHBd9qH9/Of OojgBCj4c7Rifcj0I0hNIB3ve33c2Gu4atcpNcT62acAynnpizZ9meT962E0jHvWsusf m2Bbl/z7Z6SnfiZyPdPC0oDC0JQ/0ZFhe3OkS6C6VKGv7oVt8/rzBxY/2n21O8k4BDPe oakw== X-Forwarded-Encrypted: i=1; AJvYcCWOUHgYyaK5jFpiw5RbKneBJ8DAMPds0IEKQajpfGugpItoKhBW2cBc6LuqRJd2NCHwPVKhaJjUTizi8nm3SnLh7MhHiC6wLdqDEOFxSQ/X4H3Mxsw= X-Gm-Message-State: AOJu0Ywa0Doi2+iBUCKuplO5aogMH/ovtg0Mbc2MqnCRKFcOUOVuk2Ix 4IFIld7jPuvGGc5CPfzK1p3iSb0kI2P2GgRQLnZ8tRvV4xPj2SV7thHKOZ68wA== X-Google-Smtp-Source: AGHT+IFkAi80BKvF8PjygfQV1vvybXcizCZQWAbOTCI4v5z2AeP2XUkBEmlpXEhtlrpvoxrfTZ4Amg== X-Received: by 2002:a05:6808:258:b0:3c9:6acd:c626 with SMTP id m24-20020a056808025800b003c96acdc626mr4930719oie.46.1715023489673; Mon, 06 May 2024 12:24:49 -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 ch9-20020a05622a40c900b00436e193f408sm5439870qtb.28.2024.05.06.12.24.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 12:24:48 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 06 May 2024 19:24:47 +0000 Subject: [PATCH v2 2/2] media: bcm2835-unicam: Do not print error when irq not found MIME-Version: 1.0 Message-Id: <20240506-fix-broad-v2-2-e6a2a5c0d609@chromium.org> References: <20240506-fix-broad-v2-0-e6a2a5c0d609@chromium.org> In-Reply-To: <20240506-fix-broad-v2-0-e6a2a5c0d609@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 , Laurent Pinchart X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240506_122454_555288_514BBA2A X-CRM114-Status: GOOD ( 13.29 ) 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() already prints an error for us. Fix this cocci warning: drivers/media/platform/broadcom/bcm2835-unicam.c:2664:2-9: line 2664 is redundant because platform_get_irq() already prints an error Reviewed-by: Laurent Pinchart Signed-off-by: Ricardo Ribalda --- drivers/media/platform/broadcom/bcm2835-unicam.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/media/platform/broadcom/bcm2835-unicam.c b/drivers/media/platform/broadcom/bcm2835-unicam.c index 60c0fe956c58..0b2729bf4a36 100644 --- a/drivers/media/platform/broadcom/bcm2835-unicam.c +++ b/drivers/media/platform/broadcom/bcm2835-unicam.c @@ -2660,10 +2660,8 @@ static int unicam_probe(struct platform_device *pdev) } ret = platform_get_irq(pdev, 0); - if (ret < 0) { - dev_err(&pdev->dev, "No IRQ resource\n"); + if (ret < 0) goto err_unicam_put; - } ret = devm_request_irq(&pdev->dev, ret, unicam_isr, 0, "unicam_capture0", unicam);