summaryrefslogtreecommitdiff
path: root/include/linux/ioport.h
diff options
context:
space:
mode:
authorJohn Garry <john.garry@huawei.com>2020-12-02 13:36:54 +0300
committerMarc Zyngier <maz@kernel.org>2020-12-11 17:47:50 +0300
commit9806731db684a475ade1e95d166089b9edbd9da3 (patch)
tree06bc2e0d381ab8ab36c50a7afafbf915b083846f /include/linux/ioport.h
parent1d3aec89286254487df7641c30f1b14ad1d127a5 (diff)
downloadlinux-9806731db684a475ade1e95d166089b9edbd9da3.tar.xz
resource: Add irqresource_disabled()
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
Diffstat (limited to 'include/linux/ioport.h')
-rw-r--r--include/linux/ioport.h7
1 files changed, 7 insertions, 0 deletions
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