Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp1070978rdb; Fri, 22 Dec 2023 13:51:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IEa99f4mTfMySVx6BtTP3dirS+yGnQsuKB9xZo97B3aiulLhGAF+IWhxyT7VN/PejXT1GAj X-Received: by 2002:a05:6e02:338f:b0:35d:2f2e:f17 with SMTP id bn15-20020a056e02338f00b0035d2f2e0f17mr2618066ilb.1.1703281914129; Fri, 22 Dec 2023 13:51:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703281914; cv=none; d=google.com; s=arc-20160816; b=wG7Em2g7Vj5XZcmgixA+i0ZZNc7dWoCH9HEQBVfs8tLlrsU8DTewCK6AFRrtc0hCbR PXqA+cRYeYpCnSIFveSr0st7JiK+Oq4427sJ33U32tsDOqXNyrCD6LUK2VeitlvSmguO Qlbiw2yXfcziZMcFlNRuWLv6T5PwHcqPFhZlaS2vz9vyzwNYaOnf4UZygvWyQCrH/S3U vR1Hz6yqX94WvXeRpd699vzaL6sm76BOjTw/lFJR86bQH4u/Ec9C3Pl5KYcbu7Fh1Hks BMt9DGy3qtvk6EUQRHPbVWNOFORuCZUtZQRRy1oIR4H1sLQZ0ntjKSu6eSEG5AJWu682 Hnmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=NeI6c38cgpwlUN996udLFmgW+EctHzXbCAsfLYiPUqE=; fh=M67R1c0A3ig8XWQIlrKKNlZzDnT0m59M3thjdgfeVaE=; b=qmAEU1i3KFINy/r8OPfNCK2zMF0lYqxCZJwYKQKnAU+VQXDTnKuvq7hu0zAByh5/i9 PmxXqrr1V+PWQB/Ik5TIRE/mvilG0QQGnhDEwzxFu/G8tn+wVRGvaqCaJf2siKS+XJsL Bsj41ockUEme3KONM5KCieibnrn2MtD8tLaMRnWuolzUt1rxnr8mIbsXhLmezAICvyeo j6Y4rRMdQuRMe6L8vYENHQtV3tiNd1Bjro/tDIBIArJ24OCGWyvvzCx6oFhGa6p48Ufm VQnqhnKpeai2Rnq6uOfF3V3+JFSGVF0pjNf1LqFjoSPvlX1LhWcMTDkV2PfThVem6No3 qyuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=frWj5maN; spf=pass (google.com: domain of linux-kernel+bounces-10070-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10070-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id f21-20020a170902e99500b001d420ecdaccsi1384201plb.92.2023.12.22.13.51.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 13:51:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10070-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=frWj5maN; spf=pass (google.com: domain of linux-kernel+bounces-10070-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10070-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id C5399286445 for ; Fri, 22 Dec 2023 21:51:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D07D02EAF7; Fri, 22 Dec 2023 21:51:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="frWj5maN" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-yw1-f173.google.com (mail-yw1-f173.google.com [209.85.128.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80C742EAE1 for ; Fri, 22 Dec 2023 21:51:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-yw1-f173.google.com with SMTP id 00721157ae682-5d226f51f71so22086287b3.3 for ; Fri, 22 Dec 2023 13:51:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1703281903; x=1703886703; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=NeI6c38cgpwlUN996udLFmgW+EctHzXbCAsfLYiPUqE=; b=frWj5maNQP1O6m8ekUzZyXjpDdNF8/8M1/llFa+KTj/ZBOYucfRjZCeOjUOp8MAWuz u69g2qcgaXtjiqNEPh8zLke8Qmw6LvcMFb2lQUHm8i1Bo+4535jnbXpMEPqLvQYDa5wH JmytbicvFsJ2Epru2JZoFC/SD+axhrebkSNzg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703281903; x=1703886703; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NeI6c38cgpwlUN996udLFmgW+EctHzXbCAsfLYiPUqE=; b=bCg4FSwKMQGmUs7ANbMAUuU844JtGLM6fHOoGMnJD4eB2EeGTt8BOU79Fr7Tz4HeRA vaebveSYTL7MoFqGx7aJrlnVnYTK804csBEPnryNswgsusXvANrt3bWWy7bvRSL+7mXB tq7F5LlMzx6oldS3sn6/O23vr4gJ26YRXX8SWVNGaHvV/Pf4BU/n5jeUlets6lypmdGu R8KmFdkTgb0woiVd6FV6BccUIgZegUV6jnj+E7kATFURpsHGcBMh74kjshpJlbiHk681 fzpuFpNKTLMkGUFJbO3YuUfEiarZRKGMqxO1CPdgA2jFO/9mIwlRNBKs9PjuiIr8C2Xf cqog== X-Gm-Message-State: AOJu0YxXQGgUoLDxCxOHEVnCfGjGbCT6QlEvvV7x6pVCqe8fkWA2w4FV K/A90uWwYn9DQhrqI9rdyQfRSL03isuErbJrfUkNZ29nG7HW X-Received: by 2002:a81:a04e:0:b0:5d7:1940:dd7e with SMTP id x75-20020a81a04e000000b005d71940dd7emr1872300ywg.84.1703281903502; Fri, 22 Dec 2023 13:51:43 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231220235459.2965548-1-markhas@chromium.org> <20231220165423.v2.21.Ife9ebad2bbfbab3a05e90040f344d750aa0aac7e@changeid> In-Reply-To: From: Mark Hasemeyer Date: Fri, 22 Dec 2023 14:51:32 -0700 Message-ID: Subject: Re: [PATCH v2 21/22] platform: Modify platform_get_irq_optional() to use resource To: Andy Shevchenko Cc: LKML , AngeloGioacchino Del Regno , Krzysztof Kozlowski , Tzung-Bi Shih , Raul Rangel , Konrad Dybcio , Rob Herring , Sudeep Holla , David Gow , Greg Kroah-Hartman , Mark Brown , "Rafael J. Wysocki" , Takashi Iwai , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= Content-Type: text/plain; charset="UTF-8" > > * For example:: > > * > > - * int irq = platform_get_irq_optional(pdev, 0); > > + * int irq = platform_get_irq_resource_optional(pdev, 0, &res); > > * if (irq < 0) > > * return irq; > > * > > * Return: non-zero IRQ number on success, negative error number on failure. > > Why do we need the irq to be returned via error code? We don't really. It just matches the convention of 'platform_get_irq()' and 'of_irq_to_resource()'. > > int ret; > > Missing blank line, have you run checkpatch.pl? Yes, I normally run checkpatch.pl. I may have missed the warning or it didn't catch it. I'll add it. > > > + if (IS_ERR_OR_NULL(r)) > > + return -EINVAL; > > If we ever have an error pointer in r, I prefer to see > > if (!r) > return -EINVAL; > if (IS_ERR(r)) > return PTR_ERR(r); > > But Q is the same as earlier: when would we have the error pointer in @r? I don't see when we would. I'll drop it. > Can we save this and be consistent with above fwnode API return code check? > > > + ret = ret ?: r->start; > > goto out; > > + } > > } Yep!