From: Stefani Seibold <stefani@seibold.net>
To: linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Greg KH <greg@kroah.com>
Subject: [patch] ported drivers/video/omap2/dss/rfbi.c to new kfifo API
Date: Sun, 27 Dec 2009 13:16:58 +0100 [thread overview]
Message-ID: <1261916218.21787.4.camel@wall-e> (raw)
This patch ported the drivers/video/omap2/dss/rfbi.c to the new kfifo API.
This should be the last one ;-)
The patch-set is against mm tree from 11-Dec-2009
Greetings,
Stefani
Signed-off-by: Stefani Seibold <stefani@seibold.net>
---
rfbi.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
--- mmotm.orig/drivers/video/omap2/dss/rfbi.c 2009-12-27 13:04:16.495740629 +0100
+++ mmotm.new/drivers/video/omap2/dss/rfbi.c 2009-12-27 13:08:50.188701965 +0100
@@ -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;
@@ -1013,8 +1013,9 @@ static void process_cmd_fifo(void)
while (true) {
spin_lock_irqsave(rfbi.cmd_fifo->lock, flags);
- len = __kfifo_get(rfbi.cmd_fifo, (unsigned char *)&p,
- sizeof(struct update_param));
+ len = kfifo_out_locked(&rfbi.cmd_fifo, (unsigned char *)&p,
+ sizeof(struct update_param),
+ &rfbi.cmd_lock);
if (len == 0) {
DSSDBG("nothing more in fifo\n");
atomic_set(&rfbi.cmd_pending, 0);
@@ -1053,8 +1054,7 @@ static void rfbi_push_cmd(struct update_
int available;
spin_lock_irqsave(rfbi.cmd_fifo->lock, flags);
- available = RFBI_CMD_FIFO_LEN_BYTES -
- __kfifo_len(rfbi.cmd_fifo);
+ available = kfifo_avail(&rfbi.cmd_fifo);
/* DSSDBG("%d bytes left in fifo\n", available); */
if (available < sizeof(struct update_param)) {
@@ -1066,8 +1066,9 @@ static void rfbi_push_cmd(struct update_
continue;
}
- ret = __kfifo_put(rfbi.cmd_fifo, (unsigned char *)p,
- sizeof(struct update_param));
+ ret = kfifo_in_locked(&rfbi.cmd_fifo, (unsigned char *)p,
+ sizeof(struct update_param),
+ &rfbi.cmd_lock);
/* DSSDBG("pushed %d bytes\n", ret);*/
spin_unlock_irqrestore(rfbi.cmd_fifo->lock, flags);
@@ -1157,9 +1158,7 @@ int rfbi_init(void)
u32 l;
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))
+ if (kfifo_alloc(&rfbi.cmd_fifo, RFBI_CMD_FIFO_LEN_BYTES, GFP_KERNEL))
return -ENOMEM;
init_completion(&rfbi.cmd_done);
@@ -1196,7 +1195,7 @@ void rfbi_exit(void)
{
DSSDBG("rfbi_exit\n");
- kfifo_free(rfbi.cmd_fifo);
+ kfifo_free(&rfbi.cmd_fifo);
iounmap(rfbi.base);
}
reply other threads:[~2009-12-27 12:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1261916218.21787.4.camel@wall-e \
--to=stefani@seibold.net \
--cc=akpm@linux-foundation.org \
--cc=greg@kroah.com \
--cc=linux-kernel@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