Thread (13 messages) 13 messages, 3 authors, 2025-09-05

RE: [PATCH v2 1/4] irqchip/aspeed-scu-ic: Refactor driver to support variant-based initialization

From: Ryan Chen <ryan_chen@aspeedtech.com>
Date: 2025-09-03 10:03:26
Also in: linux-arm-kernel, linux-devicetree, lkml

Thaks the review.
Subject: Re: [PATCH v2 1/4] irqchip/aspeed-scu-ic: Refactor driver to support
variant-based initialization

On Sun, Aug 31 2025 at 10:14, Ryan Chen wrote:
quoted
 	scu_ic->irq_domain = irq_domain_create_linear(of_fwnode_handle(node),
scu_ic->num_irqs,
quoted
-						   &aspeed_scu_ic_domain_ops,
-						   scu_ic);
+						      &aspeed_scu_ic_domain_ops,
+						      scu_ic);
Please move scu_ic to the previous line.
Will update in next version.
        scu_ic->irq_domain = irq_domain_create_linear(of_fwnode_handle(node), scu_ic->num_irqs,
                                                      &aspeed_scu_ic_domain_ops, scu_ic);
quoted
+aspeed_scu_ic_find_variant(struct device_node *np)
 {
-	struct aspeed_scu_ic *scu_ic = kzalloc(sizeof(*scu_ic), GFP_KERNEL);
-
-	if (!scu_ic)
-		return -ENOMEM;
+	for (int i = 0; i < ARRAY_SIZE(scu_ic_variants); i++)
+		if (of_device_is_compatible(np, scu_ic_variants[i].compatible))
+			return &scu_ic_variants[i];
the for loop wants curly brackets.

https://www.kernel.org/doc/html/latest/process/maintainer-tip.html#bracket-
rules
Thanks.
Will update

for (int i = 0; i < ARRAY_SIZE(scu_ic_variants); i++) {
	if (of_device_is_compatible(np, scu_ic_variants[i].compatible))
		return &scu_ic_variants[i];
}
quoted
+	scu_ic->irq_enable    = variant->irq_enable;
+	scu_ic->irq_shift     = variant->irq_shift;
+	scu_ic->num_irqs      = variant->num_irqs;
Please use a TAB not spaces when you want to align things.
Thanks, will update
quoted
+IRQCHIP_DECLARE(ast2600_scu_ic0, "aspeed,ast2600-scu-ic0",
aspeed_scu_ic_of_init);
quoted
+IRQCHIP_DECLARE(ast2600_scu_ic1, "aspeed,ast2600-scu-ic1",
aspeed_scu_ic_of_init);

Stray TAB in the last line.
Will remove tab
Thanks,

        tglx
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help