[patch] ported drivers/video/omap2/dss/rfbi.c to new kfifo API

From: Stefani Seibold
Date: Sun Dec 27 2009 - 07:17:41 EST


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@xxxxxxxxxxx>
---
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);
}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/