Skip to content

Commit 42b8b16

Browse files
Jiri Slaby (SUSE)KAGA-KOKO
authored andcommitted
irqdomain: Drop irq_domain_add_*() functions
Most irq_domain_add_*() functions are unused now, so drop them. The remaining ones are moved to the deprecated section and will be removed during the merge window after the patches in various trees have been merged. Note: The Chinese docs are touched but unfinished. I cannot parse those. [ tglx: Remove the leftover in irq-domain.rst and handle merge logistics ] Signed-off-by: Jiri Slaby (SUSE) <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 813da4f commit 42b8b16

File tree

4 files changed

+44
-130
lines changed

4 files changed

+44
-130
lines changed

Documentation/core-api/irq/irq-domain.rst

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@ irq_domain usage
4242
================
4343

4444
An interrupt controller driver creates and registers an irq_domain by
45-
calling one of the irq_domain_add_*() or irq_domain_create_*() functions
46-
(each mapping method has a different allocator function, more on that later).
47-
The function will return a pointer to the irq_domain on success. The caller
48-
must provide the allocator function with an irq_domain_ops structure.
45+
calling one of the irq_domain_create_*() functions. The function will
46+
return a pointer to the irq_domain on success. The caller must provide the
47+
allocator function with an irq_domain_ops structure.
4948

5049
In most cases, the irq_domain will begin empty without any mappings
5150
between hwirq and IRQ numbers. Mappings are added to the irq_domain
@@ -92,7 +91,6 @@ Linear
9291

9392
::
9493

95-
irq_domain_add_linear()
9694
irq_domain_create_linear()
9795

9896
The linear reverse map maintains a fixed size table indexed by the
@@ -105,19 +103,13 @@ map are fixed time lookup for IRQ numbers, and irq_descs are only
105103
allocated for in-use IRQs. The disadvantage is that the table must be
106104
as large as the largest possible hwirq number.
107105

108-
irq_domain_add_linear() and irq_domain_create_linear() are functionally
109-
equivalent, except for the first argument is different - the former
110-
accepts an Open Firmware specific 'struct device_node', while the latter
111-
accepts a more general abstraction 'struct fwnode_handle'.
112-
113106
The majority of drivers should use the linear map.
114107

115108
Tree
116109
----
117110

118111
::
119112

120-
irq_domain_add_tree()
121113
irq_domain_create_tree()
122114

123115
The irq_domain maintains a radix tree map from hwirq numbers to Linux
@@ -129,11 +121,6 @@ since it doesn't need to allocate a table as large as the largest
129121
hwirq number. The disadvantage is that hwirq to IRQ number lookup is
130122
dependent on how many entries are in the table.
131123

132-
irq_domain_add_tree() and irq_domain_create_tree() are functionally
133-
equivalent, except for the first argument is different - the former
134-
accepts an Open Firmware specific 'struct device_node', while the latter
135-
accepts a more general abstraction 'struct fwnode_handle'.
136-
137124
Very few drivers should need this mapping.
138125

139126
No Map
@@ -159,8 +146,6 @@ Legacy
159146

160147
::
161148

162-
irq_domain_add_simple()
163-
irq_domain_add_legacy()
164149
irq_domain_create_simple()
165150
irq_domain_create_legacy()
166151

@@ -189,13 +174,13 @@ supported. For example, ISA controllers would use the legacy map for
189174
mapping Linux IRQs 0-15 so that existing ISA drivers get the correct IRQ
190175
numbers.
191176

192-
Most users of legacy mappings should use irq_domain_add_simple() or
193-
irq_domain_create_simple() which will use a legacy domain only if an IRQ range
194-
is supplied by the system and will otherwise use a linear domain mapping.
195-
The semantics of this call are such that if an IRQ range is specified then
196-
descriptors will be allocated on-the-fly for it, and if no range is
197-
specified it will fall through to irq_domain_add_linear() or
198-
irq_domain_create_linear() which means *no* irq descriptors will be allocated.
177+
Most users of legacy mappings should use irq_domain_create_simple()
178+
which will use a legacy domain only if an IRQ range is supplied by the
179+
system and will otherwise use a linear domain mapping. The semantics of
180+
this call are such that if an IRQ range is specified then descriptors
181+
will be allocated on-the-fly for it, and if no range is specified it
182+
will fall through to irq_domain_create_linear() which means *no* irq
183+
descriptors will be allocated.
199184

200185
A typical use case for simple domains is where an irqchip provider
201186
is supporting both dynamic and static IRQ assignments.
@@ -206,12 +191,6 @@ that the driver using the simple domain call irq_create_mapping()
206191
before any irq_find_mapping() since the latter will actually work
207192
for the static IRQ assignment case.
208193

209-
irq_domain_add_simple() and irq_domain_create_simple() as well as
210-
irq_domain_add_legacy() and irq_domain_create_legacy() are functionally
211-
equivalent, except for the first argument is different - the former
212-
accepts an Open Firmware specific 'struct device_node', while the latter
213-
accepts a more general abstraction 'struct fwnode_handle'.
214-
215194
Hierarchy IRQ domain
216195
--------------------
217196

Documentation/translations/zh_CN/core-api/irq/irq-domain.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ irq_domain映射的类型
8383

8484
::
8585

86-
irq_domain_add_linear()
8786
irq_domain_create_linear()
8887

8988
线性反向映射维护了一个固定大小的表,该表以hwirq号为索引。 当一个hwirq被映射
@@ -104,7 +103,6 @@ irq_domain_add_linear()和irq_domain_create_linear()在功能上是等价的,
104103

105104
::
106105

107-
irq_domain_add_tree()
108106
irq_domain_create_tree()
109107

110108
irq_domain维护着从hwirq号到Linux IRQ的radix的树状映射。 当一个hwirq被映射时,
@@ -138,8 +136,6 @@ Linux IRQ号编入硬件本身,这样就不需要映射了。 调用irq_create
138136

139137
::
140138

141-
irq_domain_add_simple()
142-
irq_domain_add_legacy()
143139
irq_domain_create_simple()
144140
irq_domain_create_legacy()
145141

include/linux/irqdomain.h

Lines changed: 34 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,6 @@ struct irq_domain *irq_domain_create_simple(struct fwnode_handle *fwnode,
338338
unsigned int first_irq,
339339
const struct irq_domain_ops *ops,
340340
void *host_data);
341-
struct irq_domain *irq_domain_add_legacy(struct device_node *of_node,
342-
unsigned int size,
343-
unsigned int first_irq,
344-
irq_hw_number_t first_hwirq,
345-
const struct irq_domain_ops *ops,
346-
void *host_data);
347341
struct irq_domain *irq_domain_create_legacy(struct fwnode_handle *fwnode,
348342
unsigned int size,
349343
unsigned int first_irq,
@@ -396,40 +390,6 @@ static inline struct irq_domain *irq_find_host(struct device_node *node)
396390
return d;
397391
}
398392

399-
static inline struct irq_domain *irq_domain_add_simple(struct device_node *of_node,
400-
unsigned int size,
401-
unsigned int first_irq,
402-
const struct irq_domain_ops *ops,
403-
void *host_data)
404-
{
405-
return irq_domain_create_simple(of_fwnode_handle(of_node), size, first_irq, ops, host_data);
406-
}
407-
408-
/**
409-
* irq_domain_add_linear() - Allocate and register a linear revmap irq_domain.
410-
* @of_node: pointer to interrupt controller's device tree node.
411-
* @size: Number of interrupts in the domain.
412-
* @ops: map/unmap domain callbacks
413-
* @host_data: Controller private data pointer
414-
*/
415-
static inline struct irq_domain *irq_domain_add_linear(struct device_node *of_node,
416-
unsigned int size,
417-
const struct irq_domain_ops *ops,
418-
void *host_data)
419-
{
420-
struct irq_domain_info info = {
421-
.fwnode = of_fwnode_handle(of_node),
422-
.size = size,
423-
.hwirq_max = size,
424-
.ops = ops,
425-
.host_data = host_data,
426-
};
427-
struct irq_domain *d;
428-
429-
d = irq_domain_instantiate(&info);
430-
return IS_ERR(d) ? NULL : d;
431-
}
432-
433393
#ifdef CONFIG_IRQ_DOMAIN_NOMAP
434394
static inline struct irq_domain *irq_domain_create_nomap(struct fwnode_handle *fwnode,
435395
unsigned int max_irq,
@@ -452,22 +412,6 @@ static inline struct irq_domain *irq_domain_create_nomap(struct fwnode_handle *f
452412
unsigned int irq_create_direct_mapping(struct irq_domain *domain);
453413
#endif
454414

455-
static inline struct irq_domain *irq_domain_add_tree(struct device_node *of_node,
456-
const struct irq_domain_ops *ops,
457-
void *host_data)
458-
{
459-
struct irq_domain_info info = {
460-
.fwnode = of_fwnode_handle(of_node),
461-
.hwirq_max = ~0U,
462-
.ops = ops,
463-
.host_data = host_data,
464-
};
465-
struct irq_domain *d;
466-
467-
d = irq_domain_instantiate(&info);
468-
return IS_ERR(d) ? NULL : d;
469-
}
470-
471415
static inline struct irq_domain *irq_domain_create_linear(struct fwnode_handle *fwnode,
472416
unsigned int size,
473417
const struct irq_domain_ops *ops,
@@ -631,18 +575,6 @@ static inline struct irq_domain *irq_domain_create_hierarchy(struct irq_domain *
631575
return IS_ERR(d) ? NULL : d;
632576
}
633577

634-
static inline struct irq_domain *irq_domain_add_hierarchy(struct irq_domain *parent,
635-
unsigned int flags,
636-
unsigned int size,
637-
struct device_node *node,
638-
const struct irq_domain_ops *ops,
639-
void *host_data)
640-
{
641-
return irq_domain_create_hierarchy(parent, flags, size,
642-
of_fwnode_handle(node),
643-
ops, host_data);
644-
}
645-
646578
int __irq_domain_alloc_irqs(struct irq_domain *domain, int irq_base,
647579
unsigned int nr_irqs, int node, void *arg,
648580
bool realloc,
@@ -789,6 +721,40 @@ static inline struct fwnode_handle *of_node_to_fwnode(struct device_node *node)
789721
return node ? &node->fwnode : NULL;
790722
}
791723

724+
static inline struct irq_domain *irq_domain_add_tree(struct device_node *of_node,
725+
const struct irq_domain_ops *ops,
726+
void *host_data)
727+
{
728+
struct irq_domain_info info = {
729+
.fwnode = of_fwnode_handle(of_node),
730+
.hwirq_max = ~0U,
731+
.ops = ops,
732+
.host_data = host_data,
733+
};
734+
struct irq_domain *d;
735+
736+
d = irq_domain_instantiate(&info);
737+
return IS_ERR(d) ? NULL : d;
738+
}
739+
740+
static inline struct irq_domain *irq_domain_add_linear(struct device_node *of_node,
741+
unsigned int size,
742+
const struct irq_domain_ops *ops,
743+
void *host_data)
744+
{
745+
struct irq_domain_info info = {
746+
.fwnode = of_fwnode_handle(of_node),
747+
.size = size,
748+
.hwirq_max = size,
749+
.ops = ops,
750+
.host_data = host_data,
751+
};
752+
struct irq_domain *d;
753+
754+
d = irq_domain_instantiate(&info);
755+
return IS_ERR(d) ? NULL : d;
756+
}
757+
792758
#else /* CONFIG_IRQ_DOMAIN */
793759
static inline void irq_dispose_mapping(unsigned int virq) { }
794760
static inline struct irq_domain *irq_find_matching_fwnode(

kernel/irq/irqdomain.c

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -480,33 +480,6 @@ struct irq_domain *irq_domain_create_simple(struct fwnode_handle *fwnode,
480480
}
481481
EXPORT_SYMBOL_GPL(irq_domain_create_simple);
482482

483-
/**
484-
* irq_domain_add_legacy() - Allocate and register a legacy revmap irq_domain.
485-
* @of_node: pointer to interrupt controller's device tree node.
486-
* @size: total number of irqs in legacy mapping
487-
* @first_irq: first number of irq block assigned to the domain
488-
* @first_hwirq: first hwirq number to use for the translation. Should normally
489-
* be '0', but a positive integer can be used if the effective
490-
* hwirqs numbering does not begin at zero.
491-
* @ops: map/unmap domain callbacks
492-
* @host_data: Controller private data pointer
493-
*
494-
* Note: the map() callback will be called before this function returns
495-
* for all legacy interrupts except 0 (which is always the invalid irq for
496-
* a legacy controller).
497-
*/
498-
struct irq_domain *irq_domain_add_legacy(struct device_node *of_node,
499-
unsigned int size,
500-
unsigned int first_irq,
501-
irq_hw_number_t first_hwirq,
502-
const struct irq_domain_ops *ops,
503-
void *host_data)
504-
{
505-
return irq_domain_create_legacy(of_fwnode_handle(of_node), size,
506-
first_irq, first_hwirq, ops, host_data);
507-
}
508-
EXPORT_SYMBOL_GPL(irq_domain_add_legacy);
509-
510483
struct irq_domain *irq_domain_create_legacy(struct fwnode_handle *fwnode,
511484
unsigned int size,
512485
unsigned int first_irq,

0 commit comments

Comments
 (0)