mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Laura Abbott <labbott@redhat.com>
To: "Sumit Semwal" <sumit.semwal@linaro.org>,
	"John Stultz" <john.stultz@linaro.org>,
	"Arve Hjønnevåg" <arve@android.com>,
	"Riley Andrews" <riandrews@android.com>
Cc: Laura Abbott <labbott@fedoraproject.org>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	linaro-mm-sig@lists.linaro.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org,
	Eun Taik Lee <eun.taik.lee@samsung.com>,
	Liviu Dudau <Liviu.Dudau@arm.com>, Jon Medhurst <tixy@linaro.org>,
	Mitchel Humpherys <mitchelh@codeaurora.org>,
	Jeremy Gebben <jgebben@codeaurora.org>,
	Bryan Huntsman <bryanh@codeaurora.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Android Kernel Team <kernel-team@android.com>,
	Laura Abbott <labbott@redhat.com>
Subject: [RFC][PATCH 1/6] staging: android: ion: return error value for ion_device_add_heap
Date: Mon,  6 Jun 2016 11:23:28 -0700	[thread overview]
Message-ID: <1465237413-10549-2-git-send-email-labbott@redhat.com> (raw)
In-Reply-To: <1465237413-10549-1-git-send-email-labbott@redhat.com>

From: Laura Abbott <labbott@fedoraproject.org>


ion_device_add_heap doesn't return an error value. Change it to return
information to callers.

Signed-off-by: Laura Abbott <labbott@redhat.com>
---
 drivers/staging/android/ion/ion.c      | 7 +++++--
 drivers/staging/android/ion/ion_priv.h | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index a2cf93b..306340a 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -1584,14 +1584,16 @@ static int debug_shrink_get(void *data, u64 *val)
 DEFINE_SIMPLE_ATTRIBUTE(debug_shrink_fops, debug_shrink_get,
 			debug_shrink_set, "%llu\n");
 
-void ion_device_add_heap(struct ion_device *dev, struct ion_heap *heap)
+int ion_device_add_heap(struct ion_device *dev, struct ion_heap *heap)
 {
 	struct dentry *debug_file;
 
 	if (!heap->ops->allocate || !heap->ops->free || !heap->ops->map_dma ||
-	    !heap->ops->unmap_dma)
+	    !heap->ops->unmap_dma) {
 		pr_err("%s: can not add heap with invalid ops struct.\n",
 		       __func__);
+		return -EINVAL;
+	}
 
 	spin_lock_init(&heap->free_lock);
 	heap->free_list_size = 0;
@@ -1639,6 +1641,7 @@ void ion_device_add_heap(struct ion_device *dev, struct ion_heap *heap)
 	}
 
 	up_write(&dev->lock);
+	return 0;
 }
 EXPORT_SYMBOL(ion_device_add_heap);
 
diff --git a/drivers/staging/android/ion/ion_priv.h b/drivers/staging/android/ion/ion_priv.h
index 0239883..35726ae 100644
--- a/drivers/staging/android/ion/ion_priv.h
+++ b/drivers/staging/android/ion/ion_priv.h
@@ -221,7 +221,7 @@ void ion_device_destroy(struct ion_device *dev);
  * @dev:		the device
  * @heap:		the heap to add
  */
-void ion_device_add_heap(struct ion_device *dev, struct ion_heap *heap);
+int ion_device_add_heap(struct ion_device *dev, struct ion_heap *heap);
 
 /**
  * some helpers for common operations on buffers using the sg_table
-- 
2.5.5

  reply	other threads:[~2016-06-06 18:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-06 18:23 [RFC][PATCH 0/6] ion: improved ABI Laura Abbott
2016-06-06 18:23 ` Laura Abbott [this message]
2016-06-08 13:02   ` [RFC][PATCH 1/6] staging: android: ion: return error value for ion_device_add_heap Liviu Dudau
2016-06-06 18:23 ` [RFC][PATCH 2/6] staging: android: ion: Switch to using an idr to manage heaps Laura Abbott
2016-06-08 13:13   ` Liviu Dudau
2016-06-06 18:23 ` [RFC][PATCH 3/6] staging: android: ion: Drop heap type masks Laura Abbott
2016-06-06 18:23 ` [RFC][PATCH 4/6] staging: android: ion: Pull out ion ioctls to a separate file Laura Abbott
2016-06-08 13:20   ` Liviu Dudau
2016-06-06 18:23 ` [RFC][PATCH 5/6] staging: android: ion: Add an ioctl for ABI checking Laura Abbott
2016-06-06 18:23 ` [RFC][PATCH 6/6] staging: android: ion: Introduce new ioctls for dynamic heaps Laura Abbott
2016-06-08 13:50   ` Liviu Dudau
2016-06-08 17:35     ` Laura Abbott
2016-06-08 15:34   ` Brian Starkey
2016-06-08 19:14     ` Laura Abbott
2016-06-09  8:25       ` Brian Starkey
2016-06-07  6:59 ` [Linaro-mm-sig] [RFC][PATCH 0/6] ion: improved ABI Chen Feng
2016-06-08 17:29   ` Laura Abbott
2016-06-08 15:15 ` Brian Starkey
2016-06-08 18:58   ` Laura Abbott

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1465237413-10549-2-git-send-email-labbott@redhat.com \
    --to=labbott@redhat.com \
    --cc=Liviu.Dudau@arm.com \
    --cc=arve@android.com \
    --cc=bryanh@codeaurora.org \
    --cc=daniel.vetter@ffwll.ch \
    --cc=devel@driverdev.osuosl.org \
    --cc=eun.taik.lee@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jgebben@codeaurora.org \
    --cc=john.stultz@linaro.org \
    --cc=kernel-team@android.com \
    --cc=labbott@fedoraproject.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mitchelh@codeaurora.org \
    --cc=riandrews@android.com \
    --cc=sumit.semwal@linaro.org \
    --cc=tixy@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®