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 <pdaly@codeaurora.org>
[isaacm@codeaurora.org: Relocated changes to correct file]
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
This commit is contained in:
Patrick Daly 2019-08-29 15:07:05 -07:00 • committed by Isaac J. Manjarres
commit 1b851a568a

View file

@ -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;
}