linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
Cc: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Subject: [PATCH 05/15] OMAP: DSS2: RFBI: convert to new kfifo API
Date: Fri, 08 Jan 2010 13:22:39 +0000	[thread overview]
Message-ID: <1262956969-1664-6-git-send-email-tomi.valkeinen@nokia.com> (raw)
In-Reply-To: <1262956969-1664-5-git-send-email-tomi.valkeinen@nokia.com>

Compiles, but not tested.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
---
 drivers/video/omap2/dss/rfbi.c |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index d0b3006..b936495 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -120,7 +120,7 @@ static struct {
 
 	struct omap_dss_device *dssdev[2];
 
-	struct kfifo      *cmd_fifo;
+	struct kfifo      cmd_fifo;
 	spinlock_t        cmd_lock;
 	struct completion cmd_done;
 	atomic_t          cmd_fifo_full;
@@ -1011,20 +1011,20 @@ static void process_cmd_fifo(void)
 		return;
 
 	while (true) {
-		spin_lock_irqsave(rfbi.cmd_fifo->lock, flags);
+		spin_lock_irqsave(&rfbi.cmd_lock, flags);
 
-		len = __kfifo_get(rfbi.cmd_fifo, (unsigned char *)&p,
+		len = kfifo_out(&rfbi.cmd_fifo, (unsigned char *)&p,
 				  sizeof(struct update_param));
 		if (len = 0) {
 			DSSDBG("nothing more in fifo\n");
 			atomic_set(&rfbi.cmd_pending, 0);
-			spin_unlock_irqrestore(rfbi.cmd_fifo->lock, flags);
+			spin_unlock_irqrestore(&rfbi.cmd_lock, flags);
 			break;
 		}
 
 		/* DSSDBG("fifo full %d\n", rfbi.cmd_fifo_full.counter);*/
 
-		spin_unlock_irqrestore(rfbi.cmd_fifo->lock, flags);
+		spin_unlock_irqrestore(&rfbi.cmd_lock, flags);
 
 		BUG_ON(len != sizeof(struct update_param));
 		BUG_ON(p.rfbi_module > 1);
@@ -1052,25 +1052,25 @@ static void rfbi_push_cmd(struct update_param *p)
 		unsigned long flags;
 		int available;
 
-		spin_lock_irqsave(rfbi.cmd_fifo->lock, flags);
+		spin_lock_irqsave(&rfbi.cmd_lock, flags);
 		available = RFBI_CMD_FIFO_LEN_BYTES -
-			__kfifo_len(rfbi.cmd_fifo);
+			kfifo_len(&rfbi.cmd_fifo);
 
 /*		DSSDBG("%d bytes left in fifo\n", available); */
 		if (available < sizeof(struct update_param)) {
 			DSSDBG("Going to wait because FIFO FULL..\n");
-			spin_unlock_irqrestore(rfbi.cmd_fifo->lock, flags);
+			spin_unlock_irqrestore(&rfbi.cmd_lock, flags);
 			atomic_inc(&rfbi.cmd_fifo_full);
 			wait_for_completion(&rfbi.cmd_done);
 			/*DSSDBG("Woke up because fifo not full anymore\n");*/
 			continue;
 		}
 
-		ret = __kfifo_put(rfbi.cmd_fifo, (unsigned char *)p,
+		ret = kfifo_in(&rfbi.cmd_fifo, (unsigned char *)p,
 				  sizeof(struct update_param));
 /*		DSSDBG("pushed %d bytes\n", ret);*/
 
-		spin_unlock_irqrestore(rfbi.cmd_fifo->lock, flags);
+		spin_unlock_irqrestore(&rfbi.cmd_lock, flags);
 
 		BUG_ON(ret != sizeof(struct update_param));
 
@@ -1155,12 +1155,12 @@ int rfbi_init(void)
 {
 	u32 rev;
 	u32 l;
+	int r;
 
 	spin_lock_init(&rfbi.cmd_lock);
-	rfbi.cmd_fifo = kfifo_alloc(RFBI_CMD_FIFO_LEN_BYTES, GFP_KERNEL,
-				    &rfbi.cmd_lock);
-	if (IS_ERR(rfbi.cmd_fifo))
-		return -ENOMEM;
+	r = kfifo_alloc(&rfbi.cmd_fifo, RFBI_CMD_FIFO_LEN_BYTES, GFP_KERNEL);
+	if (r)
+		return r;
 
 	init_completion(&rfbi.cmd_done);
 	atomic_set(&rfbi.cmd_fifo_full, 0);
@@ -1196,7 +1196,7 @@ void rfbi_exit(void)
 {
 	DSSDBG("rfbi_exit\n");
 
-	kfifo_free(rfbi.cmd_fifo);
+	kfifo_free(&rfbi.cmd_fifo);
 
 	iounmap(rfbi.base);
 }
-- 
1.6.5


  reply	other threads:[~2010-01-08 13:22 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-08 13:22 [PATCH 00/15] OMAP DSS fixes Tomi Valkeinen
2010-01-08 13:22 ` [PATCH 01/15] OMAP: DSS2: DSI: fix VC channels in send_short and send_null Tomi Valkeinen
2010-01-08 13:22   ` [PATCH 02/15] OMAP: DSS2: DSI: print debug DCS cmd in hex Tomi Valkeinen
2010-01-08 13:22     ` [PATCH 03/15] OMAP: DSS2: Collect interrupt statistics Tomi Valkeinen
2010-01-08 13:22       ` [PATCH 04/15] OMAP: DSS2: Fix crash when panel doesn't define enable_te() Tomi Valkeinen
2010-01-08 13:22         ` Tomi Valkeinen [this message]
2010-01-08 13:22           ` [PATCH 06/15] OMAP: OMAPFB: fix clk_get for RFBI Tomi Valkeinen
2010-01-08 13:22             ` [PATCH 07/15] OMAP: OMAPFB: add dummy release function for omapdss Tomi Valkeinen
2010-01-08 13:22               ` [PATCH 08/15] MAINTAINERS: change omapfb maintainer Tomi Valkeinen
2010-01-08 13:22                 ` [PATCH 09/15] MAINTAINERS: Combine DSS2 and OMAPFB2 into one entry Tomi Valkeinen
2010-01-08 13:22                   ` [PATCH 10/15] OMAP: DSS2: Fix compile warning Tomi Valkeinen
2010-01-08 13:22                     ` [PATCH 11/15] video/omap: add __init/__exit macros to drivers/video/omap/lcd_htcherald.c Tomi Valkeinen
2010-01-08 13:22                       ` [PATCH 12/15] OMAP: DSS2: OMAPFB: fix omapfb_free_fbmem() Tomi Valkeinen
2010-01-08 13:22                         ` [PATCH 13/15] OMAP: DSS2: Make check-delay-loops consistent Tomi Valkeinen
2010-01-08 13:22                           ` [PATCH 14/15] DSS2: Reject scaling settings when they cannot be supported Tomi Valkeinen
2010-01-08 13:22                             ` [PATCH 15/15] OMAP: DSS2: OMAPFB: fix crash when panel driver was not loaded Tomi Valkeinen
2010-01-11 11:46                   ` [PATCH 09/15] MAINTAINERS: Combine DSS2 and OMAPFB2 into one Grazvydas Ignotas
2010-01-08 16:52           ` [PATCH 05/15] OMAP: DSS2: RFBI: convert to new kfifo API Tony Lindgren
2010-01-11  9:09             ` Tomi Valkeinen
2010-01-11  9:25               ` Sergey Lapin
2010-01-12 10:35                 ` Tomi Valkeinen
2010-01-08 13:29   ` [PATCH 01/15] OMAP: DSS2: DSI: fix VC channels in send_short Aguirre, Sergio
2010-01-08 13:33     ` Tomi Valkeinen

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=1262956969-1664-6-git-send-email-tomi.valkeinen@nokia.com \
    --to=tomi.valkeinen@nokia.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-omap@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).