Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit adaea782 authored by Vinayak Menon's avatar Vinayak Menon
Browse files

ion: msm_ion: remove platform driver unregister



There are certain issues reported, triggered by an unbind
of the ion platform driver via sysfs. Fixing those results
in the unbind to succeed without a panic, but causes further
issues when ION APIs are accessed after the device removal.
Though there are a number checks that need to be put to fix
these, it is doable. But there doesn't seem to be a real gain
in adding such additional checks in ION code, when the remove
method can be simply removed. The ion device destroy method
doesn't currently perform anything substantial like freeing
up of buffers. So there isn't any gain in supporting the
remove method.

Change-Id: I37476fd5158fe32f729d25840032c3faed136c58
Signed-off-by: default avatarVinayak Menon <vinmenon@codeaurora.org>
parent e86137b2
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -1311,12 +1311,3 @@ struct ion_device *ion_device_create(void)
	return idev;
}
EXPORT_SYMBOL(ion_device_create);

void ion_device_destroy(struct ion_device *dev)
{
	misc_deregister(&dev->dev);
	debugfs_remove_recursive(dev->debug_root);
	/* XXX need to free the heaps and clients ? */
	kfree(dev);
}
EXPORT_SYMBOL(ion_device_destroy);
+0 −17
Original line number Diff line number Diff line
@@ -272,12 +272,6 @@ bool ion_buffer_fault_user_mappings(struct ion_buffer *buffer);
 */
struct ion_device *ion_device_create(void);

/**
 * ion_device_destroy - free and device and it's resource
 * @dev:		the device
 */
void ion_device_destroy(struct ion_device *dev);

/**
 * ion_device_add_heap - adds a heap to the ion device
 * @dev:		the device
@@ -374,25 +368,19 @@ size_t ion_heap_freelist_size(struct ion_heap *heap);
 */

struct ion_heap *ion_heap_create(struct ion_platform_heap *heap_data);
void ion_heap_destroy(struct ion_heap *heap);

struct ion_heap *ion_system_heap_create(struct ion_platform_heap *unused);
void ion_system_heap_destroy(struct ion_heap *heap);
struct ion_heap *ion_system_contig_heap_create(struct ion_platform_heap *heap);
void ion_system_contig_heap_destroy(struct ion_heap *heap);

struct ion_heap *ion_carveout_heap_create(struct ion_platform_heap *heap_data);
void ion_carveout_heap_destroy(struct ion_heap *heap);

struct ion_heap *ion_chunk_heap_create(struct ion_platform_heap *heap_data);
void ion_chunk_heap_destroy(struct ion_heap *heap);

#ifdef CONFIG_CMA
struct ion_heap *ion_secure_cma_heap_create(struct ion_platform_heap *data);
void ion_secure_cma_heap_destroy(struct ion_heap *heap);

struct ion_heap *ion_cma_heap_create(struct ion_platform_heap *data);
void ion_cma_heap_destroy(struct ion_heap *heap);
#else
static inline struct ion_heap
			*ion_secure_cma_heap_create(struct ion_platform_heap *h)
@@ -406,19 +394,14 @@ static inline struct ion_heap *ion_cma_heap_create(struct ion_platform_heap *h)
{
	return NULL;
}

static inline void ion_cma_heap_destroy(struct ion_heap *h) {}
#endif

struct ion_heap *ion_system_secure_heap_create(struct ion_platform_heap *heap);
void ion_system_secure_heap_destroy(struct ion_heap *heap);

struct ion_heap *ion_cma_secure_heap_create(struct ion_platform_heap *heap);
void ion_cma_secure_heap_destroy(struct ion_heap *heap);

struct ion_heap *ion_secure_carveout_heap_create(
			struct ion_platform_heap *heap);
void ion_secure_carveout_heap_destroy(struct ion_heap *heap);

/**
 * functions for creating and destroying a heap pool -- allows you
+2 −2
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@ struct ion_heap *ion_carveout_heap_create(struct ion_platform_heap *heap_data)
	return __ion_carveout_heap_create(heap_data, true);
}

void ion_carveout_heap_destroy(struct ion_heap *heap)
static void ion_carveout_heap_destroy(struct ion_heap *heap)
{
	struct ion_carveout_heap *carveout_heap =
	     container_of(heap, struct  ion_carveout_heap, heap);
@@ -320,7 +320,7 @@ static int ion_sc_add_child(struct ion_sc_heap *manager,
	return -EINVAL;
}

void ion_secure_carveout_heap_destroy(struct ion_heap *heap)
static void ion_secure_carveout_heap_destroy(struct ion_heap *heap)
{
	struct ion_sc_heap *manager =
		container_of(heap, struct ion_sc_heap, heap);
+0 −10
Original line number Diff line number Diff line
@@ -165,13 +165,3 @@ struct ion_heap *ion_chunk_heap_create(struct ion_platform_heap *heap_data)
	kfree(chunk_heap);
	return ERR_PTR(ret);
}

void ion_chunk_heap_destroy(struct ion_heap *heap)
{
	struct ion_chunk_heap *chunk_heap =
	     container_of(heap, struct  ion_chunk_heap, heap);

	gen_pool_destroy(chunk_heap->pool);
	kfree(chunk_heap);
	chunk_heap = NULL;
}
+0 −14
Original line number Diff line number Diff line
@@ -198,13 +198,6 @@ struct ion_heap *ion_cma_heap_create(struct ion_platform_heap *data)
	return &cma_heap->heap;
}

void ion_cma_heap_destroy(struct ion_heap *heap)
{
	struct ion_cma_heap *cma_heap = to_cma_heap(heap);

	kfree(cma_heap);
}

static void ion_secure_cma_free(struct ion_buffer *buffer)
{
	if (ion_hyp_unassign_sg_from_flags(buffer->sg_table, buffer->flags,
@@ -266,10 +259,3 @@ struct ion_heap *ion_cma_secure_heap_create(struct ion_platform_heap *data)
	cma_heap->heap.type = (enum ion_heap_type)ION_HEAP_TYPE_HYP_CMA;
	return &cma_heap->heap;
}

void ion_cma_secure_heap_destroy(struct ion_heap *heap)
{
	struct ion_cma_heap *cma_heap = to_cma_heap(heap);

	kfree(cma_heap);
}
Loading