History

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().

Lad Prabhakar committed 4 years ago

Commit ecb78b21 parent 3b2af5c1 file · +4 −7Browse files

Unified · Split

drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c+4−7
@@ -991,16 +991,13 @@ static int acquire_bch_irq(struct gpmi_nand_data *this, irq_handler_t irq_h) · 990 unmodified lines
991991 {
992992 struct platform_device *pdev = this->pdev;
993993 const char *res_name = GPMI_NAND_BCH_INTERRUPT_RES_NAME;
994− struct resource *r;
995994 int err;
996995
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;
1002999
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);
10041001 if (err)
10051002 dev_err(this->dev, "error requesting BCH IRQ\n");
10061003