Skip to content

Commit 7206f31

Browse files
lokeshvutlaMarc Zyngier
authored andcommitted
irqchip/ti-sci-inta: Do not store TISCI device id in platform device id field
Even though DT doesn't make active use of id field in platform_device, we cannot hijack it to store TISCI device id. So create a field in struct ti_sci_inta for storing TISCI id and drop usage of id field in platform_device. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20200806074826.24607-10-lokeshvutla@ti.com
1 parent c4dff06 commit 7206f31

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

drivers/irqchip/irq-ti-sci-inta.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ struct ti_sci_inta_vint_desc {
8383
* @vint_mutex: Mutex to protect vint_list
8484
* @base: Base address of the memory mapped IO registers
8585
* @pdev: Pointer to platform device.
86+
* @ti_sci_id: TI-SCI device identifier
8687
*/
8788
struct ti_sci_inta_irq_domain {
8889
const struct ti_sci_handle *sci;
@@ -93,6 +94,7 @@ struct ti_sci_inta_irq_domain {
9394
struct mutex vint_mutex;
9495
void __iomem *base;
9596
struct platform_device *pdev;
97+
u32 ti_sci_id;
9698
};
9799

98100
#define to_vint_desc(e, i) container_of(e, struct ti_sci_inta_vint_desc, \
@@ -156,7 +158,7 @@ static struct ti_sci_inta_vint_desc *ti_sci_inta_alloc_parent_irq(struct irq_dom
156158

157159
parent_fwspec.fwnode = of_node_to_fwnode(of_irq_find_parent(dev_of_node(&inta->pdev->dev)));
158160
parent_fwspec.param_count = 2;
159-
parent_fwspec.param[0] = inta->pdev->id;
161+
parent_fwspec.param[0] = inta->ti_sci_id;
160162
parent_fwspec.param[1] = vint_desc->vint_id;
161163

162164
parent_virq = irq_create_fwspec_mapping(&parent_fwspec);
@@ -202,7 +204,7 @@ static struct ti_sci_inta_event_desc *ti_sci_inta_alloc_event(struct ti_sci_inta
202204

203205
err = inta->sci->ops.rm_irq_ops.set_event_map(inta->sci,
204206
dev_id, dev_index,
205-
inta->pdev->id,
207+
inta->ti_sci_id,
206208
vint_desc->vint_id,
207209
event_desc->global_event,
208210
free_bit);
@@ -299,7 +301,7 @@ static void ti_sci_inta_free_irq(struct ti_sci_inta_event_desc *event_desc,
299301
inta->sci->ops.rm_irq_ops.free_event_map(inta->sci,
300302
HWIRQ_TO_DEVID(hwirq),
301303
HWIRQ_TO_IRQID(hwirq),
302-
inta->pdev->id,
304+
inta->ti_sci_id,
303305
vint_desc->vint_id,
304306
event_desc->global_event,
305307
event_desc->vint_bit);
@@ -547,21 +549,21 @@ static int ti_sci_inta_irq_domain_probe(struct platform_device *pdev)
547549
return ret;
548550
}
549551

550-
ret = of_property_read_u32(dev->of_node, "ti,sci-dev-id", &pdev->id);
552+
ret = of_property_read_u32(dev->of_node, "ti,sci-dev-id", &inta->ti_sci_id);
551553
if (ret) {
552554
dev_err(dev, "missing 'ti,sci-dev-id' property\n");
553555
return -EINVAL;
554556
}
555557

556-
inta->vint = devm_ti_sci_get_of_resource(inta->sci, dev, pdev->id,
558+
inta->vint = devm_ti_sci_get_of_resource(inta->sci, dev, inta->ti_sci_id,
557559
"ti,sci-rm-range-vint");
558560
if (IS_ERR(inta->vint)) {
559561
dev_err(dev, "VINT resource allocation failed\n");
560562
return PTR_ERR(inta->vint);
561563
}
562564

563-
inta->global_event = devm_ti_sci_get_of_resource(inta->sci, dev, pdev->id,
564-
"ti,sci-rm-range-global-event");
565+
inta->global_event = devm_ti_sci_get_of_resource(inta->sci, dev, inta->ti_sci_id,
566+
"ti,sci-rm-range-global-event");
565567
if (IS_ERR(inta->global_event)) {
566568
dev_err(dev, "Global event resource allocation failed\n");
567569
return PTR_ERR(inta->global_event);

0 commit comments

Comments
 (0)