From: Vasileios Amoiridis <vassilisamir@gmail.com>
To: robh@kernel.org, saravanak@google.com,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: andriy.shevchenko@linux.intel.com,
Vasileios Amoiridis <vassilisamir@gmail.com>
Subject: [PATCH v4 2/2] of/irq: Use helper to define resources
Date: Fri, 13 Sep 2024 00:16:05 +0200 [thread overview]
Message-ID: <20240912221605.27089-3-vassilisamir@gmail.com> (raw)
In-Reply-To: <20240912221605.27089-1-vassilisamir@gmail.com>
Resources definition can become simpler and more organised by using the
dedicated helpers.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vasileios Amoiridis <vassilisamir@gmail.com>
---
drivers/of/irq.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index 5d27b20634d3..a494f56a0d0e 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -429,9 +429,8 @@ int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
of_property_read_string_index(dev, "interrupt-names", index,
&name);
- r->start = r->end = irq;
- r->flags = IORESOURCE_IRQ | irq_get_trigger_type(irq);
- r->name = name ? name : of_node_full_name(dev);
+ *r = DEFINE_RES_IRQ_NAMED(irq, name ?: of_node_full_name(dev));
+ r->flags |= irq_get_trigger_type(irq);
}
return irq;
--
2.25.1
next prev parent reply other threads:[~2024-09-12 22:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-12 22:16 [PATCH v4 0/2] Use functionality of irq_get_trigger_type() and Vasileios Amoiridis
2024-09-12 22:16 ` [PATCH v4 1/2] of/irq: Make use of irq_get_trigger_type() Vasileios Amoiridis
2024-09-12 22:16 ` Vasileios Amoiridis [this message]
2024-09-13 9:39 ` [PATCH v4 0/2] Use functionality of irq_get_trigger_type() and Andy Shevchenko
2024-09-13 19:52 ` Rob Herring (Arm)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240912221605.27089-3-vassilisamir@gmail.com \
--to=vassilisamir@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=saravanak@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).