diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2015-09-08 01:01:14 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2015-09-08 01:01:14 -0300 |
commit | e5fd91f1ef340da553f7a79da9540c3db711c937 (patch) | |
tree | b11842027dc6641da63f4bcc524f8678263304a3 /drivers/staging/android/ion | |
parent | 2a9b0348e685a63d97486f6749622b61e9e3292f (diff) |
Linux-libre 4.2-gnu
Diffstat (limited to 'drivers/staging/android/ion')
-rw-r--r-- | drivers/staging/android/ion/ion.c | 1 | ||||
-rw-r--r-- | drivers/staging/android/ion/ion_chunk_heap.c | 2 | ||||
-rw-r--r-- | drivers/staging/android/ion/ion_priv.h | 6 | ||||
-rw-r--r-- | drivers/staging/android/ion/ion_test.c | 20 | ||||
-rw-r--r-- | drivers/staging/android/ion/tegra/tegra_ion.c | 1 |
5 files changed, 25 insertions, 5 deletions
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index b0b96ab31..6f4811263 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -1579,6 +1579,7 @@ struct ion_device *ion_device_create(long (*custom_ioctl) ret = misc_register(&idev->dev); if (ret) { pr_err("ion: failed to register misc device.\n"); + kfree(idev); return ERR_PTR(ret); } diff --git a/drivers/staging/android/ion/ion_chunk_heap.c b/drivers/staging/android/ion/ion_chunk_heap.c index 3e6ec2ee6..54746157d 100644 --- a/drivers/staging/android/ion/ion_chunk_heap.c +++ b/drivers/staging/android/ion/ion_chunk_heap.c @@ -173,7 +173,7 @@ struct ion_heap *ion_chunk_heap_create(struct ion_platform_heap *heap_data) chunk_heap->heap.ops = &chunk_heap_ops; chunk_heap->heap.type = ION_HEAP_TYPE_CHUNK; chunk_heap->heap.flags = ION_HEAP_FLAG_DEFER_FREE; - pr_info("%s: base %lu size %zu align %ld\n", __func__, chunk_heap->base, + pr_debug("%s: base %lu size %zu align %ld\n", __func__, chunk_heap->base, heap_data->size, heap_data->align); return &chunk_heap->heap; diff --git a/drivers/staging/android/ion/ion_priv.h b/drivers/staging/android/ion/ion_priv.h index 18a5f93e1..52f1cd1a6 100644 --- a/drivers/staging/android/ion/ion_priv.h +++ b/drivers/staging/android/ion/ion_priv.h @@ -33,7 +33,7 @@ struct ion_buffer *ion_handle_buffer(struct ion_handle *handle); /** * struct ion_buffer - metadata for a particular buffer - * @ref: refernce count + * @ref: reference count * @node: node in the ion_device buffers tree * @dev: back pointer to the ion_device * @heap: back pointer to the heap the buffer came from @@ -46,7 +46,7 @@ struct ion_buffer *ion_handle_buffer(struct ion_handle *handle); * an ion_phys_addr_t (and someday a phys_addr_t) * @lock: protects the buffers cnt fields * @kmap_cnt: number of times the buffer is mapped to the kernel - * @vaddr: the kenrel mapping if kmap_cnt is not zero + * @vaddr: the kernel mapping if kmap_cnt is not zero * @dmap_cnt: number of times the buffer is mapped for dma * @sg_table: the sg table for the buffer if dmap_cnt is not zero * @pages: flat array of pages in the buffer -- used by fault @@ -266,7 +266,7 @@ void ion_heap_freelist_add(struct ion_heap *heap, struct ion_buffer *buffer); /** * ion_heap_freelist_drain - drain the deferred free list * @heap: the heap - * @size: ammount of memory to drain in bytes + * @size: amount of memory to drain in bytes * * Drains the indicated amount of memory from the deferred freelist immediately. * Returns the total amount freed. The total freed may be higher depending diff --git a/drivers/staging/android/ion/ion_test.c b/drivers/staging/android/ion/ion_test.c index 3bc461cbb..7d6e6b6bc 100644 --- a/drivers/staging/android/ion/ion_test.c +++ b/drivers/staging/android/ion/ion_test.c @@ -261,7 +261,20 @@ static int __init ion_test_probe(struct platform_device *pdev) return 0; } +static int ion_test_remove(struct platform_device *pdev) +{ + struct ion_test_device *testdev; + + testdev = platform_get_drvdata(pdev); + if (!testdev) + return -ENODATA; + + return misc_deregister(&testdev->misc); +} + +static struct platform_device *ion_test_pdev; static struct platform_driver ion_test_platform_driver = { + .remove = ion_test_remove, .driver = { .name = "ion-test", }, @@ -269,13 +282,18 @@ static struct platform_driver ion_test_platform_driver = { static int __init ion_test_init(void) { - platform_device_register_simple("ion-test", -1, NULL, 0); + ion_test_pdev = platform_device_register_simple("ion-test", + -1, NULL, 0); + if (!ion_test_pdev) + return -ENODEV; + return platform_driver_probe(&ion_test_platform_driver, ion_test_probe); } static void __exit ion_test_exit(void) { platform_driver_unregister(&ion_test_platform_driver); + platform_device_unregister(ion_test_pdev); } module_init(ion_test_init); diff --git a/drivers/staging/android/ion/tegra/tegra_ion.c b/drivers/staging/android/ion/tegra/tegra_ion.c index 5b8ef0e66..4d3c516cc 100644 --- a/drivers/staging/android/ion/tegra/tegra_ion.c +++ b/drivers/staging/android/ion/tegra/tegra_ion.c @@ -15,6 +15,7 @@ */ #include <linux/err.h> +#include <linux/module.h> #include <linux/platform_device.h> #include <linux/slab.h> #include "../ion.h" |