From 1b851a568ab2e11561aa008dbeb5b967f7dc97eb Mon Sep 17 00:00:00 2001 From: Patrick Daly Date: Thu, 29 Aug 2019 15:07:05 -0700 Subject: [PATCH] ion: msm: Assume devicetree support Remove support for passing parameters via platform_data now that relevant targets use devicetree. Change-Id: I2d8398163b5a4f358e257f416fd0e0c325664154 Signed-off-by: Patrick Daly [isaacm@codeaurora.org: Relocated changes to correct file] Signed-off-by: Isaac J. Manjarres --- drivers/staging/android/ion/heaps/msm_ion.c | 34 ++++----------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/drivers/staging/android/ion/heaps/msm_ion.c b/drivers/staging/android/ion/heaps/msm_ion.c index 13e51bc61173..b6a9145e1708 100644 --- a/drivers/staging/android/ion/heaps/msm_ion.c +++ b/drivers/staging/android/ion/heaps/msm_ion.c @@ -32,7 +32,6 @@ struct ion_heap_desc { const char *name; }; -#ifdef CONFIG_OF static struct ion_heap_desc ion_heap_meta[] = { { .id = ION_SYSTEM_HEAP_ID, @@ -79,9 +78,7 @@ static struct ion_heap_desc ion_heap_meta[] = { .name = ION_SECURE_CARVEOUT_HEAP_NAME, } }; -#endif -#ifdef CONFIG_OF #define MAKE_HEAP_TYPE_MAPPING(h) { .name = #h, \ .heap_type = ION_HEAP_TYPE_##h, } @@ -395,16 +392,6 @@ free_heaps: free_pdata(pdata); return ERR_PTR(ret); } -#else -static struct ion_platform_data *msm_ion_parse_dt(struct platform_device *pdev) -{ - return NULL; -} - -static void free_pdata(const struct ion_platform_data *pdata) -{ -} -#endif struct ion_heap *get_ion_heap(int heap_id) { @@ -426,20 +413,13 @@ struct ion_heap *get_ion_heap(int heap_id) static int msm_ion_probe(struct platform_device *pdev) { struct ion_platform_data *pdata; - unsigned int pdata_needs_to_be_freed; int err = -1; int i; - if (pdev->dev.of_node) { - pdata = msm_ion_parse_dt(pdev); - if (IS_ERR(pdata)) { - status = ION_INIT_FAILURE; - return PTR_ERR(pdata); - } - pdata_needs_to_be_freed = 1; - } else { - pdata = pdev->dev.platform_data; - pdata_needs_to_be_freed = 0; + pdata = msm_ion_parse_dt(pdev); + if (IS_ERR(pdata)) { + status = ION_INIT_FAILURE; + return PTR_ERR(pdata); } num_heaps = pdata->nr; @@ -472,8 +452,7 @@ static int msm_ion_probe(struct platform_device *pdev) ion_device_add_heap(heaps[i]); } - if (pdata_needs_to_be_freed) - free_pdata(pdata); + free_pdata(pdata); /* * Publish the status at the end, so our interfaces know that they @@ -485,8 +464,7 @@ static int msm_ion_probe(struct platform_device *pdev) out: kfree(heaps); - if (pdata_needs_to_be_freed) - free_pdata(pdata); + free_pdata(pdata); status = ION_INIT_FAILURE; return err; }