Skip to content

Commit 5db2a25

Browse files
committed
Merge tag 'irq-urgent-2026-02-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq fixes from Ingo Molnar: "Misc irqchip fixes: - Fix a regression in the ls-extirq irqchip driver - Fix an irqchip platform enumeration regression in the simple-pm-bus driver" * tag 'irq-urgent-2026-02-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: bus: simple-pm-bus: Probe the Layerscape SCFG node irqchip/ls-extirq: Convert to a platform driver to make it work again
2 parents 162b424 + ba5c657 commit 5db2a25

2 files changed

Lines changed: 42 additions & 39 deletions

File tree

drivers/bus/simple-pm-bus.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@ static const struct of_device_id simple_pm_bus_of_match[] = {
142142
{ .compatible = "simple-mfd", .data = ONLY_BUS },
143143
{ .compatible = "isa", .data = ONLY_BUS },
144144
{ .compatible = "arm,amba-bus", .data = ONLY_BUS },
145+
{ .compatible = "fsl,ls1021a-scfg", },
146+
{ .compatible = "fsl,ls1043a-scfg", },
147+
{ .compatible = "fsl,ls1046a-scfg", },
148+
{ .compatible = "fsl,ls1088a-isc", },
149+
{ .compatible = "fsl,ls2080a-isc", },
150+
{ .compatible = "fsl,lx2160a-isc", },
145151
{ /* sentinel */ }
146152
};
147153
MODULE_DEVICE_TABLE(of, simple_pm_bus_of_match);

drivers/irqchip/irq-ls-extirq.c

Lines changed: 36 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -168,40 +168,34 @@ ls_extirq_parse_map(struct ls_extirq_data *priv, struct device_node *node)
168168
return 0;
169169
}
170170

171-
static int __init
172-
ls_extirq_of_init(struct device_node *node, struct device_node *parent)
171+
static int ls_extirq_probe(struct platform_device *pdev)
173172
{
174173
struct irq_domain *domain, *parent_domain;
174+
struct device_node *node, *parent;
175+
struct device *dev = &pdev->dev;
175176
struct ls_extirq_data *priv;
176177
int ret;
177178

179+
node = dev->of_node;
180+
parent = of_irq_find_parent(node);
181+
if (!parent)
182+
return dev_err_probe(dev, -ENODEV, "Failed to get IRQ parent node\n");
183+
178184
parent_domain = irq_find_host(parent);
179-
if (!parent_domain) {
180-
pr_err("Cannot find parent domain\n");
181-
ret = -ENODEV;
182-
goto err_irq_find_host;
183-
}
185+
if (!parent_domain)
186+
return dev_err_probe(dev, -EPROBE_DEFER, "Cannot find parent domain\n");
184187

185-
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
186-
if (!priv) {
187-
ret = -ENOMEM;
188-
goto err_alloc_priv;
189-
}
188+
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
189+
if (!priv)
190+
return dev_err_probe(dev, -ENOMEM, "Failed to allocate memory\n");
190191

191-
/*
192-
* All extirq OF nodes are under a scfg/syscon node with
193-
* the 'ranges' property
194-
*/
195-
priv->intpcr = of_iomap(node, 0);
196-
if (!priv->intpcr) {
197-
pr_err("Cannot ioremap OF node %pOF\n", node);
198-
ret = -ENOMEM;
199-
goto err_iomap;
200-
}
192+
priv->intpcr = devm_of_iomap(dev, node, 0, NULL);
193+
if (!priv->intpcr)
194+
return dev_err_probe(dev, -ENOMEM, "Cannot ioremap OF node %pOF\n", node);
201195

202196
ret = ls_extirq_parse_map(priv, node);
203197
if (ret)
204-
goto err_parse_map;
198+
return dev_err_probe(dev, ret, "Failed to parse IRQ map\n");
205199

206200
priv->big_endian = of_device_is_big_endian(node->parent);
207201
priv->is_ls1021a_or_ls1043a = of_device_is_compatible(node, "fsl,ls1021a-extirq") ||
@@ -210,23 +204,26 @@ ls_extirq_of_init(struct device_node *node, struct device_node *parent)
210204

211205
domain = irq_domain_create_hierarchy(parent_domain, 0, priv->nirq, of_fwnode_handle(node),
212206
&extirq_domain_ops, priv);
213-
if (!domain) {
214-
ret = -ENOMEM;
215-
goto err_add_hierarchy;
216-
}
207+
if (!domain)
208+
return dev_err_probe(dev, -ENOMEM, "Failed to add IRQ domain\n");
217209

218210
return 0;
219-
220-
err_add_hierarchy:
221-
err_parse_map:
222-
iounmap(priv->intpcr);
223-
err_iomap:
224-
kfree(priv);
225-
err_alloc_priv:
226-
err_irq_find_host:
227-
return ret;
228211
}
229212

230-
IRQCHIP_DECLARE(ls1021a_extirq, "fsl,ls1021a-extirq", ls_extirq_of_init);
231-
IRQCHIP_DECLARE(ls1043a_extirq, "fsl,ls1043a-extirq", ls_extirq_of_init);
232-
IRQCHIP_DECLARE(ls1088a_extirq, "fsl,ls1088a-extirq", ls_extirq_of_init);
213+
static const struct of_device_id ls_extirq_dt_ids[] = {
214+
{ .compatible = "fsl,ls1021a-extirq" },
215+
{ .compatible = "fsl,ls1043a-extirq" },
216+
{ .compatible = "fsl,ls1088a-extirq" },
217+
{}
218+
};
219+
MODULE_DEVICE_TABLE(of, ls_extirq_dt_ids);
220+
221+
static struct platform_driver ls_extirq_driver = {
222+
.probe = ls_extirq_probe,
223+
.driver = {
224+
.name = "ls-extirq",
225+
.of_match_table = ls_extirq_dt_ids,
226+
}
227+
};
228+
229+
builtin_platform_driver(ls_extirq_driver);

0 commit comments

Comments
 (0)