diff mbox

kms: Return a negative error code in kms_bo_create()

Message ID 1351762722-8012-1-git-send-email-laurent.pinchart@ideasonboard.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Pinchart Nov. 1, 2012, 9:38 a.m. UTC
The function returns returns 0 on success or a negative value in case of an
error, except when given invalid attributes in which case it returns the
positive EINVAL value. Replace that with -EINVAL to allow the caller to detect
errors with a < 0 check.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 libkms/api.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Jakob Bornecrantz Nov. 2, 2012, 12:16 p.m. UTC | #1
On Thu, Nov 1, 2012 at 10:38 AM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> The function returns returns 0 on success or a negative value in case of an
> error, except when given invalid attributes in which case it returns the
> positive EINVAL value. Replace that with -EINVAL to allow the caller to detect
> errors with a < 0 check.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
diff mbox

Patch

diff --git a/libkms/api.c b/libkms/api.c
index 4a05f3d..5befaa0 100644
--- a/libkms/api.c
+++ b/libkms/api.c
@@ -80,7 +80,7 @@  int kms_bo_create(struct kms_driver *kms, const unsigned *attr, struct kms_bo **
 			type = value;
 			break;
 		default:
-			return EINVAL;
+			return -EINVAL;
 		}
 	}