From a0e052ce2a796d005064b8bfb0d1bc78475d5642 Mon Sep 17 00:00:00 2001 From: Jordan Crouse Date: Wed, 1 Apr 2020 12:02:32 -0600 Subject: [PATCH] msm: kgsl: Remove legacy platform probe table Remove the legacy platform id_table and just rely on the standard of_match_table instead. Use the standard macro for specifying the match table pointer and set the MODULE_DEVICE_TABLE. Change-Id: Ic0dedbad84f80b28d1885a7326324eb67ef97d9b Signed-off-by: Jordan Crouse --- drivers/gpu/msm/adreno.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/msm/adreno.c b/drivers/gpu/msm/adreno.c index fd3a2c378442..cd37ab764648 100644 --- a/drivers/gpu/msm/adreno.c +++ b/drivers/gpu/msm/adreno.c @@ -764,18 +764,13 @@ static int adreno_identify_gpu(struct adreno_device *adreno_dev) return 0; } -static const struct platform_device_id adreno_id_table[] = { - { "kgsl-3d0", (unsigned long) &device_3d0, }, - {}, -}; - -MODULE_DEVICE_TABLE(platform, adreno_id_table); - static const struct of_device_id adreno_match_table[] = { { .compatible = "qcom,kgsl-3d0", .data = &device_3d0 }, - {} + { }, }; +MODULE_DEVICE_TABLE(of, adreno_match_table); + /* Dynamically build the OPP table for the GPU device */ static void adreno_build_opp_table(struct device *dev, struct kgsl_pwrctrl *pwr) { @@ -1311,18 +1306,13 @@ static void adreno_setup_device(struct adreno_device *adreno_dev) static int adreno_bind(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); - const struct of_device_id *of_id; struct adreno_device *adreno_dev; struct kgsl_device *device; int status; unsigned int priv = 0; u32 size, hwrev; - of_id = of_match_device(adreno_match_table, &pdev->dev); - if (!of_id) - return -EINVAL; - - adreno_dev = (struct adreno_device *) of_id->data; + adreno_dev = (struct adreno_device *) of_device_get_match_data(dev); /* Initialize the adreno device structure */ adreno_setup_device(adreno_dev); @@ -1499,17 +1489,12 @@ static void _adreno_free_memories(struct adreno_device *adreno_dev) static void adreno_unbind(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - const struct of_device_id *of_id; struct adreno_device *adreno_dev; struct kgsl_device *device; struct adreno_gpudev *gpudev; - of_id = of_match_device(adreno_match_table, &pdev->dev); - if (!of_id) - return; + adreno_dev = (struct adreno_device *) of_device_get_match_data(dev); - adreno_dev = (struct adreno_device *) of_id->data; device = KGSL_DEVICE(adreno_dev); gpudev = ADRENO_GPU_DEVICE(adreno_dev); @@ -3781,11 +3766,10 @@ static const struct dev_pm_ops adreno_pm_ops = { static struct platform_driver adreno_platform_driver = { .probe = adreno_probe, .remove = adreno_remove, - .id_table = adreno_id_table, .driver = { .name = "kgsl-3d", .pm = &adreno_pm_ops, - .of_match_table = adreno_match_table, + .of_match_table = of_match_ptr(adreno_match_table), } };