From patchwork Wed Dec 2 10:36:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 335974 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp811428ejs; Wed, 2 Dec 2020 02:43:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJwYdPkIPAFDDf6dIfNsWdKVDLO8YLlRpfXR4Oo1l5bKxn2AxPOtsVGN/rBNU1RDlUQLUjCc X-Received: by 2002:a17:907:a96:: with SMTP id by22mr1609454ejc.171.1606905802624; Wed, 02 Dec 2020 02:43:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606905802; cv=none; d=google.com; s=arc-20160816; b=clRJNxsv7K0WgNhiDcnn5rj0Hm5C9+jEdgo0aiX6Px1ZYarEKwP3JXuEfyr96xAEif vdVR9IBqEYAcm5F5O/7nOZgOCEHOmzEBGOZ2oeG/w1RFvXKELwChlaZd1wDbA/MHlz8f +0sGbdt2zX6kCzkUdRjJ//9yFi86XGdaYWbi156mkQr0FHUzHumXUdQ0cXTkphuItO6U JqngDYeEgzx1Wx0RT+WL1lC9dEOLoHe9hQH8Dq/5DIaBs3SYKAS8zUBwmtfcuRfmiPuY n7KYQ7R+xPY1yqAQB9B1jsKLsdA/9MxEZWzY+28I5tlsPFVEOwiPJ5z58e/77R5nE4K3 VJHQ== 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=lQrJ+9e2pRX4OvSOfDFclBIXU30mebtCIzSFXXKNLXc=; b=P1rv6kvq+Za21e/8qoQxKYUDxN17ktmMZvrmADQM+KQ9pDv6yDGFBZq9QOJy3Unnf4 B7TXm6R+PHT4rcyTQOGmr0baulnTwizMBQ7AKsPp6lEOPTLIoK4NU0TYl7JJICM2ZsQO re0zFNR8bhnYjBycxkXPmtg/3Q1rk+iFyJWP0ak81xSf09r0J0fxkQCi3N9M2Eg/8IjQ +e+T93uSCRJ//iEVK8BGy804psuZtXcxyRUNqKMLF8FDOU5v60VY4ImgOzrjSgsh9oa1 ZJ5Vbn3a0mqfW4P0hDrAKXfhPSoj/QmJZ/z2DL7dnfa4rxm6b5v2Bz9pmmj5BeY5iBvd v7Iw== 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 a15si811195eds.424.2020.12.02.02.43.22; Wed, 02 Dec 2020 02:43:22 -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 S2388621AbgLBKll (ORCPT + 5 others); Wed, 2 Dec 2020 05:41:41 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:8490 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388620AbgLBKll (ORCPT ); Wed, 2 Dec 2020 05:41:41 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4CmFqS54jczhlkn; Wed, 2 Dec 2020 18:40:36 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Wed, 2 Dec 2020 18:40:48 +0800 From: John Garry To: , , , , , , CC: , , , , , "John Garry" Subject: [PATCH v5 2/5] resource: Add irqresource_disabled() Date: Wed, 2 Dec 2020 18:36:54 +0800 Message-ID: <1606905417-183214-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1606905417-183214-1-git-send-email-john.garry@huawei.com> References: <1606905417-183214-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 Reviewed-by: Rafael J. Wysocki --- include/linux/ioport.h | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.26.2 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