memory: tegra: Use of_match_ptr() for mc-hwpm device id

- Use of_match_ptr() for mc-hwpm device id
- Add module_exit function
- Add error print if mc-hwpm driver fails to register

Bug 5313972

Change-Id: I695cede736949d828fee2db09617b68515cf40fd
Signed-off-by: Ashish Mhetre <amhetre@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3374385
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
This commit is contained in:
Ashish Mhetre
2025-06-02 07:01:34 +00:00
committed by Jon Hunter
parent 93fde3b573
commit 5608649145

View File

@@ -140,7 +140,7 @@ static int tegra_mc_hwpm_hwpm_probe(struct platform_device *pdev)
static struct platform_driver mc_hwpm_driver = {
.driver = {
.name = "tegra264-mc-hwpm",
.of_match_table = mc_hwpm_of_ids,
.of_match_table = of_match_ptr(mc_hwpm_of_ids),
.owner = THIS_MODULE,
},
@@ -149,10 +149,22 @@ static struct platform_driver mc_hwpm_driver = {
static int __init tegra_mc_hwpm_init(void)
{
return platform_driver_register(&mc_hwpm_driver);
int ret = platform_driver_register(&mc_hwpm_driver);
if (ret) {
pr_err("Failed to register MC-HWPM driver\n");
}
return ret;
}
module_init(tegra_mc_hwpm_init);
static void __exit tegra_mc_hwpm_exit(void)
{
platform_driver_unregister(&mc_hwpm_driver);
}
module_exit(tegra_mc_hwpm_exit);
MODULE_AUTHOR("Ashish Mhetre <amhetre@nvidia.com>");
MODULE_DESCRIPTION("Tegra264 MC-HWPM driver");
MODULE_LICENSE("GPL v2");