nv-gpu-static-pg: t264: fix null pointer of driver data

Fix the sequence in nv-gpu-static-pg probe function
to get platform driver data after set.

Bug 5516617

Signed-off-by: Shao-Chun Kao <shaochunk@nvidia.com>

Change-Id: I55c6c234a751db202c9038d7f5ee0cae7c32a5eb
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3496622
Tested-by: Shao-Chun Kao <shaochunk@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Shao-Chun Kao <shaochunk@nvidia.com>
This commit is contained in:
Shao-Chun Kao
2025-11-21 22:55:15 +08:00
committed by mobile promotions
parent 8369748b12
commit 7313487650

View File

@@ -64,7 +64,7 @@ static ssize_t bpmp_set_gpu_pg_mask(struct tegra_bpmp *bpmp, uint32_t gpu_pg_mas
ret = tegra_bpmp_transfer(bpmp, &msg); ret = tegra_bpmp_transfer(bpmp, &msg);
if (ret != 0) if (ret != 0)
ret = -EINVAL; ret = -EIO;
return ret; return ret;
} }
@@ -221,6 +221,7 @@ static int gpu_static_pg_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "Failed to allocate gpu_pg_profile_drv_data!\n"); dev_err(&pdev->dev, "Failed to allocate gpu_pg_profile_drv_data!\n");
return -ENOMEM; return -ENOMEM;
} }
platform_set_drvdata(pdev, gpu_pg_profile_drv_data);
/* Get the corresponding BPMP instance */ /* Get the corresponding BPMP instance */
bpmp = tegra_bpmp_get(&pdev->dev); bpmp = tegra_bpmp_get(&pdev->dev);
@@ -247,7 +248,6 @@ static int gpu_static_pg_probe(struct platform_device *pdev)
goto put_kobject; goto put_kobject;
} }
platform_set_drvdata(pdev, gpu_pg_profile_drv_data);
return ret; return ret;