|
8 | 8 | */ |
9 | 9 |
|
10 | 10 | #include <linux/bitfield.h> |
11 | | -#include <linux/cleanup.h> |
12 | 11 | #include <linux/clk.h> |
13 | 12 | #include <linux/err.h> |
14 | 13 | #include <linux/io.h> |
@@ -528,18 +527,15 @@ static int rzg2l_irqc_parse_interrupts(struct rzg2l_irqc_priv *priv, |
528 | 527 | return 0; |
529 | 528 | } |
530 | 529 |
|
531 | | -static int rzg2l_irqc_common_init(struct device_node *node, struct device_node *parent, |
532 | | - const struct irq_chip *irq_chip) |
| 530 | +static int rzg2l_irqc_common_probe(struct platform_device *pdev, struct device_node *parent, |
| 531 | + const struct irq_chip *irq_chip) |
533 | 532 | { |
534 | | - struct platform_device *pdev = of_find_device_by_node(node); |
535 | | - struct device *dev __free(put_device) = pdev ? &pdev->dev : NULL; |
536 | 533 | struct irq_domain *irq_domain, *parent_domain; |
| 534 | + struct device_node *node = pdev->dev.of_node; |
| 535 | + struct device *dev = &pdev->dev; |
537 | 536 | struct reset_control *resetn; |
538 | 537 | int ret; |
539 | 538 |
|
540 | | - if (!pdev) |
541 | | - return -ENODEV; |
542 | | - |
543 | 539 | parent_domain = irq_find_host(parent); |
544 | 540 | if (!parent_domain) |
545 | 541 | return dev_err_probe(dev, -ENODEV, "cannot find parent domain\n"); |
@@ -583,33 +579,22 @@ static int rzg2l_irqc_common_init(struct device_node *node, struct device_node * |
583 | 579 |
|
584 | 580 | register_syscore_ops(&rzg2l_irqc_syscore_ops); |
585 | 581 |
|
586 | | - /* |
587 | | - * Prevent the cleanup function from invoking put_device by assigning |
588 | | - * NULL to dev. |
589 | | - * |
590 | | - * make coccicheck will complain about missing put_device calls, but |
591 | | - * those are false positives, as dev will be automatically "put" via |
592 | | - * __free_put_device on the failing path. |
593 | | - * On the successful path we don't actually want to "put" dev. |
594 | | - */ |
595 | | - dev = NULL; |
596 | | - |
597 | 582 | return 0; |
598 | 583 | } |
599 | 584 |
|
600 | | -static int rzg2l_irqc_init(struct device_node *node, struct device_node *parent) |
| 585 | +static int rzg2l_irqc_probe(struct platform_device *pdev, struct device_node *parent) |
601 | 586 | { |
602 | | - return rzg2l_irqc_common_init(node, parent, &rzg2l_irqc_chip); |
| 587 | + return rzg2l_irqc_common_probe(pdev, parent, &rzg2l_irqc_chip); |
603 | 588 | } |
604 | 589 |
|
605 | | -static int rzfive_irqc_init(struct device_node *node, struct device_node *parent) |
| 590 | +static int rzfive_irqc_probe(struct platform_device *pdev, struct device_node *parent) |
606 | 591 | { |
607 | | - return rzg2l_irqc_common_init(node, parent, &rzfive_irqc_chip); |
| 592 | + return rzg2l_irqc_common_probe(pdev, parent, &rzfive_irqc_chip); |
608 | 593 | } |
609 | 594 |
|
610 | 595 | IRQCHIP_PLATFORM_DRIVER_BEGIN(rzg2l_irqc) |
611 | | -IRQCHIP_MATCH("renesas,rzg2l-irqc", rzg2l_irqc_init) |
612 | | -IRQCHIP_MATCH("renesas,r9a07g043f-irqc", rzfive_irqc_init) |
| 596 | +IRQCHIP_MATCH("renesas,rzg2l-irqc", rzg2l_irqc_probe) |
| 597 | +IRQCHIP_MATCH("renesas,r9a07g043f-irqc", rzfive_irqc_probe) |
613 | 598 | IRQCHIP_PLATFORM_DRIVER_END(rzg2l_irqc) |
614 | 599 | MODULE_AUTHOR("Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>"); |
615 | 600 | MODULE_DESCRIPTION("Renesas RZ/G2L IRQC Driver"); |
0 commit comments