diff options
author | John Garry <john.garry@huawei.com> | 2020-12-02 18:36:54 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-10-25 11:53:22 +0200 |
commit | 583913b1a6673ef1e932f6b6c86e7729edfd7e5a (patch) | |
tree | 16528dad44f617870961f491fa8fad7eb9c78175 /include | |
parent | d6878d39b67587a30c85062f36a3e3152a552b39 (diff) |
resource: Add irqresource_disabled()
[ Upstream commit 9806731db684a475ade1e95d166089b9edbd9da3 ]
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 <john.garry@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/1606905417-183214-3-git-send-email-john.garry@huawei.com
Stable-dep-of: c1ed72171ed5 ("ACPI: resource: Skip IRQ override on ASUS ExpertBook B1402CBA")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ioport.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index fdc201d61460..d94db8d6df52 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h @@ -300,6 +300,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 |