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 <saravanak@google.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20200718000637.3632841-3-saravanak@google.com
This commit is contained in:
parent
f8410e6265
commit
5be57099d4
1 changed files with 3 additions and 23 deletions
|
@ -432,28 +432,8 @@ fail:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int qcom_pdc_probe(struct platform_device *pdev)
|
IRQCHIP_PLATFORM_DRIVER_BEGIN(qcom_pdc)
|
||||||
{
|
IRQCHIP_MATCH("qcom,pdc", qcom_pdc_init)
|
||||||
struct device_node *np = pdev->dev.of_node;
|
IRQCHIP_PLATFORM_DRIVER_END(qcom_pdc)
|
||||||
struct device_node *parent = of_irq_find_parent(np);
|
|
||||||
|
|
||||||
return qcom_pdc_init(np, parent);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct of_device_id qcom_pdc_match_table[] = {
|
|
||||||
{ .compatible = "qcom,pdc" },
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
MODULE_DEVICE_TABLE(of, qcom_pdc_match_table);
|
|
||||||
|
|
||||||
static struct platform_driver qcom_pdc_driver = {
|
|
||||||
.probe = qcom_pdc_probe,
|
|
||||||
.driver = {
|
|
||||||
.name = "qcom-pdc",
|
|
||||||
.of_match_table = qcom_pdc_match_table,
|
|
||||||
.suppress_bind_attrs = true,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
module_platform_driver(qcom_pdc_driver);
|
|
||||||
MODULE_DESCRIPTION("Qualcomm Technologies, Inc. Power Domain Controller");
|
MODULE_DESCRIPTION("Qualcomm Technologies, Inc. Power Domain Controller");
|
||||||
MODULE_LICENSE("GPL v2");
|
MODULE_LICENSE("GPL v2");
|
||||||
|
|
Loading…
Add table
Reference in a new issue