]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
irqdomain: Drop of_node_to_fwnode()
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Wed, 19 Mar 2025 09:29:04 +0000 (10:29 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 16 May 2025 19:06:08 +0000 (21:06 +0200)
All uses of of_node_to_fwnode() in non-irqdomain code were changed to
"officially" defined of_fwnode_handle(). Therefore, the former can be
dropped along with the last uses in the irqdomain code.

Due to merge logistics the inline cannot be dropped immediately. Move it to
a deprecated section, which will be removed during the merge window.

[ tglx: Handle merge logistics ]

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250319092951.37667-12-jirislaby@kernel.org
include/linux/irqdomain.h
kernel/irq/irqdomain.c

index df7e9278c8aceae968bd270f971382f18fdb94e0..91ed86feac07ab1333ccb817c92f8f7545f85d15 100644 (file)
@@ -358,11 +358,6 @@ int irq_domain_alloc_descs(int virq, unsigned int nr_irqs,
                           irq_hw_number_t hwirq, int node,
                           const struct irq_affinity_desc *affinity);
 
-static inline struct fwnode_handle *of_node_to_fwnode(struct device_node *node)
-{
-       return node ? &node->fwnode : NULL;
-}
-
 extern const struct fwnode_operations irqchip_fwnode_ops;
 
 static inline bool is_fwnode_irqchip(const struct fwnode_handle *fwnode)
@@ -387,7 +382,7 @@ struct irq_domain *irq_find_matching_fwnode(struct fwnode_handle *fwnode,
 static inline struct irq_domain *irq_find_matching_host(struct device_node *node,
                                                        enum irq_domain_bus_token bus_token)
 {
-       return irq_find_matching_fwnode(of_node_to_fwnode(node), bus_token);
+       return irq_find_matching_fwnode(of_fwnode_handle(node), bus_token);
 }
 
 static inline struct irq_domain *irq_find_host(struct device_node *node)
@@ -407,7 +402,7 @@ static inline struct irq_domain *irq_domain_add_simple(struct device_node *of_no
                                                       const struct irq_domain_ops *ops,
                                                       void *host_data)
 {
-       return irq_domain_create_simple(of_node_to_fwnode(of_node), size, first_irq, ops, host_data);
+       return irq_domain_create_simple(of_fwnode_handle(of_node), size, first_irq, ops, host_data);
 }
 
 /**
@@ -423,7 +418,7 @@ static inline struct irq_domain *irq_domain_add_linear(struct device_node *of_no
                                         void *host_data)
 {
        struct irq_domain_info info = {
-               .fwnode         = of_node_to_fwnode(of_node),
+               .fwnode         = of_fwnode_handle(of_node),
                .size           = size,
                .hwirq_max      = size,
                .ops            = ops,
@@ -442,7 +437,7 @@ static inline struct irq_domain *irq_domain_add_nomap(struct device_node *of_nod
                                         void *host_data)
 {
        struct irq_domain_info info = {
-               .fwnode         = of_node_to_fwnode(of_node),
+               .fwnode         = of_fwnode_handle(of_node),
                .hwirq_max      = max_irq,
                .direct_max     = max_irq,
                .ops            = ops,
@@ -462,7 +457,7 @@ static inline struct irq_domain *irq_domain_add_tree(struct device_node *of_node
                                         void *host_data)
 {
        struct irq_domain_info info = {
-               .fwnode         = of_node_to_fwnode(of_node),
+               .fwnode         = of_fwnode_handle(of_node),
                .hwirq_max      = ~0U,
                .ops            = ops,
                .host_data      = host_data,
@@ -611,7 +606,7 @@ static inline struct irq_domain *irq_domain_add_hierarchy(struct irq_domain *par
                                            void *host_data)
 {
        return irq_domain_create_hierarchy(parent, flags, size,
-                                          of_node_to_fwnode(node),
+                                          of_fwnode_handle(node),
                                           ops, host_data);
 }
 
@@ -755,6 +750,12 @@ static inline void msi_device_domain_free_wired(struct irq_domain *domain, unsig
 }
 #endif
 
+/* Deprecated functions. Will be removed in the merge window */
+static inline struct fwnode_handle *of_node_to_fwnode(struct device_node *node)
+{
+       return node ? &node->fwnode : NULL;
+}
+
 #else /* CONFIG_IRQ_DOMAIN */
 static inline void irq_dispose_mapping(unsigned int virq) { }
 static inline struct irq_domain *irq_find_matching_fwnode(
index b294c3ff73b6c47793518fc495bc0b43c57c2db0..0eb99d247cebbe4ad518ed23d802fd4edb53f903 100644 (file)
@@ -502,7 +502,7 @@ struct irq_domain *irq_domain_add_legacy(struct device_node *of_node,
                                         const struct irq_domain_ops *ops,
                                         void *host_data)
 {
-       return irq_domain_create_legacy(of_node_to_fwnode(of_node), size,
+       return irq_domain_create_legacy(of_fwnode_handle(of_node), size,
                                        first_irq, first_hwirq, ops, host_data);
 }
 EXPORT_SYMBOL_GPL(irq_domain_add_legacy);
@@ -885,7 +885,7 @@ void of_phandle_args_to_fwspec(struct device_node *np, const u32 *args,
 {
        int i;
 
-       fwspec->fwnode = of_node_to_fwnode(np);
+       fwspec->fwnode = of_fwnode_handle(np);
        fwspec->param_count = count;
 
        for (i = 0; i < count; i++)