Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp88278rdh; Mon, 18 Dec 2023 12:23:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IFOwhh3zYoFI4bDZmY0aOCg3I9ch9bz2EU7BSQoF5Rl8+JYru+8VBFrb3wGm27F9DJMq6Wm X-Received: by 2002:a17:906:f592:b0:a19:a19a:eaae with SMTP id cm18-20020a170906f59200b00a19a19aeaaemr10396923ejd.103.1702931037533; Mon, 18 Dec 2023 12:23:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702931037; cv=none; d=google.com; s=arc-20160816; b=yOzvGVIs7Z/oHmTwCwHgKgcJLG0ycSq+1pvpIXntTghS78dRUZ5Qy+hut0WK9FONUo DioyHuQXkfjJ8dB9CneoSYIlh/OKRjbWg/GCxu1T9qS9U9qeTlOS+f3WEJrBgmJj2EKj nXFp6u3k1csM7H6oakrJMg7wezvl03X4BqCmB4yBfCW2JF008Rk/xtcV2Tu52mEyl55q TRWtMxKAIv/ms/AM25XYlcNn5A1ZvXQ1BAxatl7yrgJyMiALi6whzoZBCp2yQv27740v koWAs2FS4cCLYeCwwHc0x9gzPcAd/Yf6fiEsUCscZrve3Mpju6Jri6a2mFWezqAztJVC gPwA== 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=oAOApaxX5w4YPf3CxKGTBU9zqwQMevlp45gnxWR7mxI=; fh=e13fgfu7XXma9xE7FzkVidlrGxf353wtqBHOVkL5YKM=; b=qClNqD5jDcyxos4fCQjD+lsnrwf3lVVfCqTe2Ugzbe9fJbWQpL4WLEbA4pTGJsGx3D 2Q47qtmhCIAvPLchtL00p3eqifgDUtSszs+oPrxvfduWso0QfsxKZpDbv0R/3D36losP NdN+QjWLZ2+cL/Y4adkCDlxXWUI8b/Js2nAek9ZUZSgwM2BJcyeFb58U2gsFJQwvQA92 uI1oSXixNCOxySlRN3Z+Ju4RhLGXjfGx/3RgTVZ5ERCMhxLgVt9OCEGkS1CUE1izGdVd xvjiaJH/g+HYZmy9XrqrI8DIFwIEpZmIx3kPGGPQTcIxF353eDZ1re7P3ONffyDDGczv ES2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hBXG+ze1; spf=pass (google.com: domain of linux-kernel+bounces-4344-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4344-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s19-20020a170906bc5300b00a234954328dsi1547093ejv.233.2023.12.18.12.23.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 12:23:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4344-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 header.i=@chromium.org header.s=google header.b=hBXG+ze1; spf=pass (google.com: domain of linux-kernel+bounces-4344-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4344-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 487421F24409 for ; Mon, 18 Dec 2023 20:23:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4260A73469; Mon, 18 Dec 2023 20:23:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="hBXG+ze1" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-yb1-f176.google.com (mail-yb1-f176.google.com [209.85.219.176]) (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 F10F648784 for ; Mon, 18 Dec 2023 20:23:46 +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-yb1-f176.google.com with SMTP id 3f1490d57ef6-dbcd0928530so2252012276.1 for ; Mon, 18 Dec 2023 12:23:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1702931026; x=1703535826; 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=oAOApaxX5w4YPf3CxKGTBU9zqwQMevlp45gnxWR7mxI=; b=hBXG+ze1V89ncabPvpqxY0t6HBydcMjlWw5eFdEF9nhLGhQpv0PZyeUJxA1OCzpkQE 1S8tHa5dwX5UIEUpZFidEKsfOtozas0Btzh0+7L9s5xkQjzAM57MJwKYhOBzUb9ZnzI2 knCZKmOzBuf8rdjNlPdpzpHWszqOG2GAN+fKA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702931026; x=1703535826; 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=oAOApaxX5w4YPf3CxKGTBU9zqwQMevlp45gnxWR7mxI=; b=AxbJF1Sy8vfRobE/tcZkO0dx3RLCVN0fR7doiTKPUI9Q2nKsgr0cXgOMoarlj0AYmv RvG9hpKk9F2GX8aC6OJ7DdZqNk4k4+pHGaUqtMFAqTS7STZVvb2KB+uVm32Tte1+PU3i 0x1NUoCY7nar7iQsfPQJJL1lUTIjQBWXfHdJL8d01dIRJslnARDN/hyjsc98d8VPdXgs ebEJVnVBTrfK1pJFDlZLeXl2vMBLKwg5jFKC/GrjyKHgGfek7j9j7hjcIyorUfWeIxOO Rle/6A1BN6JiXk7WMHmjVDLXGsupep1hToisxkaQVXdWbmCQIqokPYyOBo6L9KSPHOuU qP+Q== X-Gm-Message-State: AOJu0Yx7CZDrsOxUgN9kJkacY0nFnNX1r9Mmxhnr6X21WcvtZV3pmFgN HwVWQVGdPk4y3xeip5ZXuSu1ClraZARPJ1dS1lqJbw== X-Received: by 2002:a25:9e11:0:b0:dbc:bff8:5228 with SMTP id m17-20020a259e11000000b00dbcbff85228mr5798639ybq.31.1702931025970; Mon, 18 Dec 2023 12:23:45 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231213110009.v1.1.Ifd0903f1c351e84376d71dbdadbd43931197f5ea@changeid> <20231213110009.v1.5.Ife9ebad2bbfbab3a05e90040f344d750aa0aac7e@changeid> In-Reply-To: From: Mark Hasemeyer Date: Mon, 18 Dec 2023 13:23:35 -0700 Message-ID: Subject: Re: [PATCH v1 5/6] platform: Modify platform_get_irq_optional() to use resource To: Andy Shevchenko Cc: LKML , Raul Rangel , 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" > > + *r = (struct resource)DEFINE_RES_IRQ(ret); > > Why is the annotation needed? It's not needed anymore. I'll remove it. > > - struct resource *r; > > + struct resource *platform_res; > > > > if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) { > > - ret = of_irq_get(dev->dev.of_node, num); > > + ret = of_irq_to_resource(dev->dev.of_node, num, r); > > if (ret > 0 || ret == -EPROBE_DEFER) > > goto out; > > } > > > > + if (has_acpi_companion(&dev->dev)) { > > + ret = acpi_irq_get(ACPI_HANDLE(&dev->dev), num, r); > > + if (!ret || ret == -EPROBE_DEFER) { > > + ret = ret ?: r->start; > > + goto out; > > + } > > + } > > Consider combine the above to use fwnode_irq_get() in the separate prerequisite > change. I like the idea. It doesn't look like 'struct fwnode_operations' provides a way to retrieve information in a 'struct resource' format. Perhaps this could be followed up on in a separate patch train? > > > + irqd_set_trigger_type(irqd, r->flags & IORESOURCE_BITS); > > NIH resource_type(). > > > + } > > return ret; Does NIH mean "not invented here"? resource_type() masks IORESOURCE_TYPE_BITS, not IORESOURCE_BITS. I'm not quite sure what you mean here.