Skip to content

Commit 5be5709

Browse files
Saravana KannanMarc Zyngier
authored andcommitted
irqchip/qcom-pdc: Switch to using IRQCHIP_PLATFORM_DRIVER helper macros
Switch the driver to use the helper macros. In addition to reducing the number of lines, this also adds module unload protection (if the driver is compiled as a module) by switching from module_platform_driver to builtin_platform_driver. Signed-off-by: Saravana Kannan <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent f8410e6 commit 5be5709

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

drivers/irqchip/qcom-pdc.c

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -432,28 +432,8 @@ static int qcom_pdc_init(struct device_node *node, struct device_node *parent)
432432
return ret;
433433
}
434434

435-
static int qcom_pdc_probe(struct platform_device *pdev)
436-
{
437-
struct device_node *np = pdev->dev.of_node;
438-
struct device_node *parent = of_irq_find_parent(np);
439-
440-
return qcom_pdc_init(np, parent);
441-
}
442-
443-
static const struct of_device_id qcom_pdc_match_table[] = {
444-
{ .compatible = "qcom,pdc" },
445-
{}
446-
};
447-
MODULE_DEVICE_TABLE(of, qcom_pdc_match_table);
448-
449-
static struct platform_driver qcom_pdc_driver = {
450-
.probe = qcom_pdc_probe,
451-
.driver = {
452-
.name = "qcom-pdc",
453-
.of_match_table = qcom_pdc_match_table,
454-
.suppress_bind_attrs = true,
455-
},
456-
};
457-
module_platform_driver(qcom_pdc_driver);
435+
IRQCHIP_PLATFORM_DRIVER_BEGIN(qcom_pdc)
436+
IRQCHIP_MATCH("qcom,pdc", qcom_pdc_init)
437+
IRQCHIP_PLATFORM_DRIVER_END(qcom_pdc)
458438
MODULE_DESCRIPTION("Qualcomm Technologies, Inc. Power Domain Controller");
459439
MODULE_LICENSE("GPL v2");

0 commit comments

Comments
 (0)