diff mbox series

[v4,2/5] resource: Add irqresource_disabled()

Message ID 1606757759-6076-3-git-send-email-john.garry@huawei.com
State Superseded
Headers show
Series Support managed interrupts for platform devices | expand

Commit Message

John Garry Nov. 30, 2020, 5:35 p.m. UTC
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>
---
 include/linux/ioport.h | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Rafael J. Wysocki Dec. 1, 2020, 7:02 p.m. UTC | #1
On Mon, Nov 30, 2020 at 6:41 PM John Garry <john.garry@huawei.com> wrote:
>
> 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>

Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

> ---
>  include/linux/ioport.h | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> 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
> --
> 2.26.2
>
diff mbox series

Patch

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