Re: [PATCH 5/8] irqchip/loongson-pch-lpc: add OF init code

From: Thomas Gleixner

Date: Sun Feb 01 2026 - 11:19:59 EST


On Sat, Jan 31 2026 at 17:45, Icenowy Zheng wrote:

> As the (kernel-internally) OF-based MIPS Loongson-3 systems can also

What are kernel-internally systems?

> have PCH LPC interrupt controller, add OF-based initialization code for

have a ... controller.

Add OF ....

> +#ifdef CONFIG_OF
> +static int pch_lpc_of_init(struct device_node *node,
> + struct device_node *parent)

No line break required.

> +{
> + int parent_irq;
> + struct fwnode_handle *irq_handle;
> + struct resource res;

Variable ordering.

> + if (of_address_to_resource(node, 0, &res))
> + return -EINVAL;
> +
> + parent_irq = irq_of_parse_and_map(node, 0);
> + if (!parent_irq) {
> + pr_err("Failed to get the parent IRQ for LPC IRQs\n");
> + return -EINVAL;
> + }
> +
> + irq_handle = of_fwnode_handle(node);
> +
> + return pch_lpc_init(res.start, resource_size(&res), irq_handle,
> + parent_irq);

If pch_lpc_init() fails the parent interrupt mapping is leaked, no?

Thanks,

tglx