All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yoichi Yuasa <yuasa@linux-mips.org>
To: Greg Kroah-Hartman <greg@kroah.com>
Cc: yuasa@linux-mips.org, Naren Sankar <nsankar@broadcom.com>,
	Jarod Wilson <jarod@wilsonet.com>,
	Scott Davilla <davilla@4pi.com>,
	Manu Abraham <abraham.manu@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 08/11] staging: crystalhd: clean up crystalhd_user_open() return code
Date: Sun, 25 Apr 2010 22:41:43 +0900	[thread overview]
Message-ID: <20100425224143.31584a1d.yuasa@linux-mips.org> (raw)
In-Reply-To: <20100425221851.223dc284.yuasa@linux-mips.org>

Signed-off-by: Yoichi Yuasa <yuasa@linux-mips.org>
---
 drivers/staging/crystalhd/crystalhd_cmds.c |   10 +++++-----
 drivers/staging/crystalhd/crystalhd_cmds.h |    2 +-
 drivers/staging/crystalhd/crystalhd_lnx.c  |    9 ++++-----
 3 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/crystalhd/crystalhd_cmds.c b/drivers/staging/crystalhd/crystalhd_cmds.c
index d341876..1286ed9 100644
--- a/drivers/staging/crystalhd/crystalhd_cmds.c
+++ b/drivers/staging/crystalhd/crystalhd_cmds.c
@@ -875,20 +875,20 @@ BC_STATUS crystalhd_resume(struct crystalhd_cmd *ctx)
  * application specific resources. HW layer initialization
  * is done for the first open request.
  */
-BC_STATUS crystalhd_user_open(struct crystalhd_cmd *ctx,
-			    struct crystalhd_user **user_ctx)
+int crystalhd_user_open(struct crystalhd_cmd *ctx,
+			struct crystalhd_user **user_ctx)
 {
 	struct crystalhd_user *uc;
 
 	if (!ctx || !user_ctx) {
 		BCMLOG_ERR("Invalid arg..\n");
-		return BC_STS_INV_ARG;
+		return -EINVAL;
 	}
 
 	uc = bc_cproc_get_uid(ctx);
 	if (!uc) {
 		BCMLOG(BCMLOG_INFO, "No free user context...\n");
-		return BC_STS_BUSY;
+		return -EBUSY;
 	}
 
 	BCMLOG(BCMLOG_INFO, "Opening new user[%x] handle\n", uc->uid);
@@ -899,7 +899,7 @@ BC_STATUS crystalhd_user_open(struct crystalhd_cmd *ctx,
 
 	*user_ctx = uc;
 
-	return BC_STS_SUCCESS;
+	return 0;
 }
 
 /**
diff --git a/drivers/staging/crystalhd/crystalhd_cmds.h b/drivers/staging/crystalhd/crystalhd_cmds.h
index 026a07e..8e15bf2 100644
--- a/drivers/staging/crystalhd/crystalhd_cmds.h
+++ b/drivers/staging/crystalhd/crystalhd_cmds.h
@@ -79,7 +79,7 @@ BC_STATUS crystalhd_suspend(struct crystalhd_cmd *ctx, crystalhd_ioctl_data *ida
 BC_STATUS crystalhd_resume(struct crystalhd_cmd *ctx);
 crystalhd_cmd_proc crystalhd_get_cmd_proc(struct crystalhd_cmd *ctx, uint32_t cmd,
 				      struct crystalhd_user *uc);
-BC_STATUS crystalhd_user_open(struct crystalhd_cmd *ctx, struct crystalhd_user **user_ctx);
+int crystalhd_user_open(struct crystalhd_cmd *ctx, struct crystalhd_user **user_ctx);
 void crystalhd_user_close(struct crystalhd_cmd *ctx, struct crystalhd_user *uc);
 int crystalhd_setup_cmd_context(struct crystalhd_cmd *ctx, struct crystalhd_adp *adp);
 void crystalhd_delete_cmd_context(struct crystalhd_cmd *ctx);
diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c b/drivers/staging/crystalhd/crystalhd_lnx.c
index 19769df..6f3c7a0 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.c
+++ b/drivers/staging/crystalhd/crystalhd_lnx.c
@@ -294,8 +294,7 @@ static int chd_dec_ioctl(struct inode *in, struct file *fd,
 static int chd_dec_open(struct inode *in, struct file *fd)
 {
 	struct crystalhd_adp *adp = chd_get_adp();
-	int rc = 0;
-	BC_STATUS sts = BC_STS_SUCCESS;
+	int rc;
 	struct crystalhd_user *uc = NULL;
 
 	BCMLOG_ENTER;
@@ -309,9 +308,9 @@ static int chd_dec_open(struct inode *in, struct file *fd)
 		return -EBUSY;
 	}
 
-	sts = crystalhd_user_open(&adp->cmds, &uc);
-	if (sts != BC_STS_SUCCESS) {
-		BCMLOG_ERR("cmd_user_open - %d \n", sts);
+	rc = crystalhd_user_open(&adp->cmds, &uc);
+	if (rc) {
+		BCMLOG_ERR("cmd_user_open - %d \n", rc);
 		rc = -EBUSY;
 	}
 
-- 
1.7.1


  parent reply	other threads:[~2010-04-25 13:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-25 13:18 [PATCH 01/11] staging: crystalhd: remove unused bc_dts_types.h Yoichi Yuasa
2010-04-25 13:21 ` [PATCH 02/11] staging: crystalhd: remove unused definitions in header files Yoichi Yuasa
2010-04-25 13:22 ` [PATCH 03/11] staging: crystalhd: remove unused BC_STATUS codes Yoichi Yuasa
2010-04-25 13:23 ` [PATCH 04/11] staging: crystalhd: mark all local functions static Yoichi Yuasa
2010-04-25 13:24 ` [PATCH 05/11] staging: crystalhd: clean up crystalhd_setup_cmd_context() return code Yoichi Yuasa
2010-04-25 13:40 ` [PATCH 06/11] staging: crystalhd: clean up crystalhd_delete_cmd_context() " Yoichi Yuasa
2010-04-25 13:41 ` [PATCH 07/11] staging: cyrstalhd: clean up crystalhd_user_close() " Yoichi Yuasa
2010-04-25 13:41 ` Yoichi Yuasa [this message]
2010-04-25 13:42 ` [PATCH 09/11] staging: crystalhd: clean up crystalhd_put_ddr2sleep() " Yoichi Yuasa
2010-04-25 13:42 ` [PATCH 10/11] staging: crystalhd: remove unneeded crystalhd_put_in_reset() " Yoichi Yuasa
2010-04-25 13:42 ` [PATCH 11/11] staging: crystalhd: remove unneeded crystalhd_stop_device() " Yoichi Yuasa
2010-04-29 19:09 ` [PATCH 01/11] staging: crystalhd: remove unused bc_dts_types.h Greg KH
2010-04-29 19:10 ` Greg KH
2010-04-30  0:40   ` Yoichi Yuasa
2010-04-30  1:41     ` Greg KH
2010-04-30  5:14       ` Yoichi Yuasa

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=20100425224143.31584a1d.yuasa@linux-mips.org \
    --to=yuasa@linux-mips.org \
    --cc=abraham.manu@gmail.com \
    --cc=davilla@4pi.com \
    --cc=greg@kroah.com \
    --cc=jarod@wilsonet.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nsankar@broadcom.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.