Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: rawnand: gpmi: Use platform_get_irq_byname() to get the interrupt

platform_get_resource_byname(pdev, IORESOURCE_IRQ, ..) relies on static
allocation of IRQ resources in DT core code, this causes an issue
when using hierarchical interrupt domains using "interrupts" property
in the node as this bypasses the hierarchical setup and messes up the
irq chaining.

In preparation for removal of static setup of IRQ resource from DT core
code use platform_get_irq_byname().

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20211221212609.31290-3-prabhakar.mahadev-lad.rj@bp.renesas.com

authored by

Lad Prabhakar and committed by
Miquel Raynal
ecb78b29 3b2af5c6

+4 -7
+4 -7
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
··· 991 991 { 992 992 struct platform_device *pdev = this->pdev; 993 993 const char *res_name = GPMI_NAND_BCH_INTERRUPT_RES_NAME; 994 - struct resource *r; 995 994 int err; 996 995 997 - r = platform_get_resource_byname(pdev, IORESOURCE_IRQ, res_name); 998 - if (!r) { 999 - dev_err(this->dev, "Can't get resource for %s\n", res_name); 1000 - return -ENODEV; 1001 - } 996 + err = platform_get_irq_byname(pdev, res_name); 997 + if (err < 0) 998 + return err; 1002 999 1003 - err = devm_request_irq(this->dev, r->start, irq_h, 0, res_name, this); 1000 + err = devm_request_irq(this->dev, err, irq_h, 0, res_name, this); 1004 1001 if (err) 1005 1002 dev_err(this->dev, "error requesting BCH IRQ\n"); 1006 1003