From patchwork Mon Nov 30 17:35:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 334719 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp4896631ilb; Mon, 30 Nov 2020 09:41:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8vz4KCfX3s3fS3VSv+im+DUxtYXrENYU/PztJ/iE5+JZm7qJ0QmsoXI7b56PQsZmuvc4a X-Received: by 2002:aa7:da03:: with SMTP id r3mr8184600eds.155.1606758112013; Mon, 30 Nov 2020 09:41:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606758112; cv=none; d=google.com; s=arc-20160816; b=lJ7unYLM+ifuYoHdJp915hQ1CbE+UxjbE4bLImR1bRmO1e68HHLibnj5pFVkDBtnsQ NOxyJbG8B08bmV6Xh4PgTlXGpXCtH+c2dIE3FLYTxrAQ/QiIACN25eLVx+8RBQpS5EqC ar9b0guwbdTSqE/V0ML3Ugqtsa3r+H+F33L0b421Ilgu7E4MboP1U6fBw9pYIGPIzhWc AeCWQec/LcbyqP+4NqS0acCbweXBCvBjGxhQ1MHeAPVbDIyvwaZDNvImj7lK/8cttZXw zBvDzN2jLYoG4UPw+AhVGgE6WxIae3H94eSd2q9kwSvNC0K67BmLqvxahWF+PeVwN9yT 6oKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=I9RHjRMykTJGgETkGDuYy5IbWq891nlJjI/yOuC2Qvs=; b=rflnvCeT1z4HW+eUo4G9RGPgwmU8BZIzd8uO5RCPxRHGyLkmkkr1TxUCbl6NUtZTX6 2KM8EF/sJBDg5fUDIr1++UbXk1HCmgixONu3NF+UFsakJyCZiU/s7Av+gYaF1BCzcAfo yd/iAWWbVsmlzNtqBhiAm3Z1I/aoP0X8fNZrwPyQDUNQWRSPs6nZolZqL981Cm/4osuc 4Y+UdGkmvlcJHj4dMZ5OLdPRPodOI7xlYOwyMJjvlZVehH28A/iTRBgvnoFKnwxFMjPN YwN1XqtNF8dccYJWCaZlINJ65bUunQrEnMRR8avB/o0+xB8LeyAZSuakf+vmSbOL3qPd ql0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b27si11520228eje.466.2020.11.30.09.41.51; Mon, 30 Nov 2020 09:41:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729504AbgK3Rkn (ORCPT + 5 others); Mon, 30 Nov 2020 12:40:43 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:8887 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728451AbgK3Rkn (ORCPT ); Mon, 30 Nov 2020 12:40:43 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4ClCCp0s86z76N1; Tue, 1 Dec 2020 01:39:34 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Tue, 1 Dec 2020 01:39:49 +0800 From: John Garry To: , , , , , , CC: , , , , , "John Garry" Subject: [PATCH v4 2/5] resource: Add irqresource_disabled() Date: Tue, 1 Dec 2020 01:35:56 +0800 Message-ID: <1606757759-6076-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1606757759-6076-1-git-send-email-john.garry@huawei.com> References: <1606757759-6076-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Add a common function to set the fields for a irq resource to disabled, which mimics what is done in acpi_dev_irqresource_disabled(), with a view to replace that function. Signed-off-by: John Garry --- include/linux/ioport.h | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.26.2 Reviewed-by: Rafael J. Wysocki diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 5135d4b86cd6..f9bf374f9633 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h @@ -307,6 +307,13 @@ struct resource *devm_request_free_mem_region(struct device *dev, struct resource *request_free_mem_region(struct resource *base, unsigned long size, const char *name); +static inline void irqresource_disabled(struct resource *res, u32 irq) +{ + res->start = irq; + res->end = irq; + res->flags = IORESOURCE_IRQ | IORESOURCE_DISABLED | IORESOURCE_UNSET; +} + #ifdef CONFIG_IO_STRICT_DEVMEM void revoke_devmem(struct resource *res); #else