diff options
Diffstat (limited to 'drivers/video/omap2/dss/rfbi.c')
-rw-r--r-- | 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 d0b3006ad8a..b936495c065 100644 --- a/drivers/video/omap2/dss/rfbi.c +++ b/drivers/video/omap2/dss/rfbi.c | |||
@@ -120,7 +120,7 @@ static struct { | |||
120 | 120 | ||
121 | struct omap_dss_device *dssdev[2]; | 121 | struct omap_dss_device *dssdev[2]; |
122 | 122 | ||
123 | struct kfifo *cmd_fifo; | 123 | struct kfifo cmd_fifo; |
124 | spinlock_t cmd_lock; | 124 | spinlock_t cmd_lock; |
125 | struct completion cmd_done; | 125 | struct completion cmd_done; |
126 | atomic_t cmd_fifo_full; | 126 | atomic_t cmd_fifo_full; |
@@ -1011,20 +1011,20 @@ static void process_cmd_fifo(void) | |||
1011 | return; | 1011 | return; |
1012 | 1012 | ||
1013 | while (true) { | 1013 | while (true) { |
1014 | spin_lock_irqsave(rfbi.cmd_fifo->lock, flags); | 1014 | spin_lock_irqsave(&rfbi.cmd_lock, flags); |
1015 | 1015 | ||
1016 | len = __kfifo_get(rfbi.cmd_fifo, (unsigned char *)&p, | 1016 | len = kfifo_out(&rfbi.cmd_fifo, (unsigned char *)&p, |
1017 | sizeof(struct update_param)); | 1017 | sizeof(struct update_param)); |
1018 | if (len == 0) { | 1018 | if (len == 0) { |
1019 | DSSDBG("nothing more in fifo\n"); | 1019 | DSSDBG("nothing more in fifo\n"); |
1020 | atomic_set(&rfbi.cmd_pending, 0); | 1020 | atomic_set(&rfbi.cmd_pending, 0); |
1021 | spin_unlock_irqrestore(rfbi.cmd_fifo->lock, flags); | 1021 | spin_unlock_irqrestore(&rfbi.cmd_lock, flags); |
1022 | break; | 1022 | break; |
1023 | } | 1023 | } |
1024 | 1024 | ||
1025 | /* DSSDBG("fifo full %d\n", rfbi.cmd_fifo_full.counter);*/ | 1025 | /* DSSDBG("fifo full %d\n", rfbi.cmd_fifo_full.counter);*/ |
1026 | 1026 | ||
1027 | spin_unlock_irqrestore(rfbi.cmd_fifo->lock, flags); | 1027 | spin_unlock_irqrestore(&rfbi.cmd_lock, flags); |
1028 | 1028 | ||
1029 | BUG_ON(len != sizeof(struct update_param)); | 1029 | BUG_ON(len != sizeof(struct update_param)); |
1030 | BUG_ON(p.rfbi_module > 1); | 1030 | BUG_ON(p.rfbi_module > 1); |
@@ -1052,25 +1052,25 @@ static void rfbi_push_cmd(struct update_param *p) | |||
1052 | unsigned long flags; | 1052 | unsigned long flags; |
1053 | int available; | 1053 | int available; |
1054 | 1054 | ||
1055 | spin_lock_irqsave(rfbi.cmd_fifo->lock, flags); | 1055 | spin_lock_irqsave(&rfbi.cmd_lock, flags); |
1056 | available = RFBI_CMD_FIFO_LEN_BYTES - | 1056 | available = RFBI_CMD_FIFO_LEN_BYTES - |
1057 | __kfifo_len(rfbi.cmd_fifo); | 1057 | kfifo_len(&rfbi.cmd_fifo); |
1058 | 1058 | ||
1059 | /* DSSDBG("%d bytes left in fifo\n", available); */ | 1059 | /* DSSDBG("%d bytes left in fifo\n", available); */ |
1060 | if (available < sizeof(struct update_param)) { | 1060 | if (available < sizeof(struct update_param)) { |
1061 | DSSDBG("Going to wait because FIFO FULL..\n"); | 1061 | DSSDBG("Going to wait because FIFO FULL..\n"); |
1062 | spin_unlock_irqrestore(rfbi.cmd_fifo->lock, flags); | 1062 | spin_unlock_irqrestore(&rfbi.cmd_lock, flags); |
1063 | atomic_inc(&rfbi.cmd_fifo_full); | 1063 | atomic_inc(&rfbi.cmd_fifo_full); |
1064 | wait_for_completion(&rfbi.cmd_done); | 1064 | wait_for_completion(&rfbi.cmd_done); |
1065 | /*DSSDBG("Woke up because fifo not full anymore\n");*/ | 1065 | /*DSSDBG("Woke up because fifo not full anymore\n");*/ |
1066 | continue; | 1066 | continue; |
1067 | } | 1067 | } |
1068 | 1068 | ||
1069 | ret = __kfifo_put(rfbi.cmd_fifo, (unsigned char *)p, | 1069 | ret = kfifo_in(&rfbi.cmd_fifo, (unsigned char *)p, |
1070 | sizeof(struct update_param)); | 1070 | sizeof(struct update_param)); |
1071 | /* DSSDBG("pushed %d bytes\n", ret);*/ | 1071 | /* DSSDBG("pushed %d bytes\n", ret);*/ |
1072 | 1072 | ||
1073 | spin_unlock_irqrestore(rfbi.cmd_fifo->lock, flags); | 1073 | spin_unlock_irqrestore(&rfbi.cmd_lock, flags); |
1074 | 1074 | ||
1075 | BUG_ON(ret != sizeof(struct update_param)); | 1075 | BUG_ON(ret != sizeof(struct update_param)); |
1076 | 1076 | ||
@@ -1155,12 +1155,12 @@ int rfbi_init(void) | |||
1155 | { | 1155 | { |
1156 | u32 rev; | 1156 | u32 rev; |
1157 | u32 l; | 1157 | u32 l; |
1158 | int r; | ||
1158 | 1159 | ||
1159 | spin_lock_init(&rfbi.cmd_lock); | 1160 | spin_lock_init(&rfbi.cmd_lock); |
1160 | rfbi.cmd_fifo = kfifo_alloc(RFBI_CMD_FIFO_LEN_BYTES, GFP_KERNEL, | 1161 | r = kfifo_alloc(&rfbi.cmd_fifo, RFBI_CMD_FIFO_LEN_BYTES, GFP_KERNEL); |
1161 | &rfbi.cmd_lock); | 1162 | if (r) |
1162 | if (IS_ERR(rfbi.cmd_fifo)) | 1163 | return r; |
1163 | return -ENOMEM; | ||
1164 | 1164 | ||
1165 | init_completion(&rfbi.cmd_done); | 1165 | init_completion(&rfbi.cmd_done); |
1166 | atomic_set(&rfbi.cmd_fifo_full, 0); | 1166 | atomic_set(&rfbi.cmd_fifo_full, 0); |
@@ -1196,7 +1196,7 @@ void rfbi_exit(void) | |||
1196 | { | 1196 | { |
1197 | DSSDBG("rfbi_exit\n"); | 1197 | DSSDBG("rfbi_exit\n"); |
1198 | 1198 | ||
1199 | kfifo_free(rfbi.cmd_fifo); | 1199 | kfifo_free(&rfbi.cmd_fifo); |
1200 | 1200 | ||
1201 | iounmap(rfbi.base); | 1201 | iounmap(rfbi.base); |
1202 | } | 1202 | } |