From 3b7db500b98a945ba5e2f4a64cbb3737b45737e2 Mon Sep 17 00:00:00 2001 From: John Garry Date: Tue, 3 Aug 2021 14:47:31 +0800 Subject: [PATCH] resource: Add irqresource_disabled() mainline inclusion from mainline-master commit 9806731db684a475ade1e95d166089b9edbd9da3 category: bugfix bugzilla: 175270 CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=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 Signed-off-by: Marc Zyngier Reviewed-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/1606905417-183214-3-git-send-email-john.garry@huawei.com Reviewed-by: Ouyangdelong Signed-off-by: Nifujia Signed-off-by: Zheng Zengkai --- include/linux/ioport.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 84a716fd6029..eee569900c7d 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h @@ -308,6 +308,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 -- GitLab