aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/mx1_camera.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/mx1_camera.c')
-rw-r--r--drivers/media/video/mx1_camera.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/media/video/mx1_camera.c b/drivers/media/video/mx1_camera.c
index 055d11ddb038..4296a8350298 100644
--- a/drivers/media/video/mx1_camera.c
+++ b/drivers/media/video/mx1_camera.c
@@ -126,13 +126,8 @@ static int mx1_videobuf_setup(struct videobuf_queue *vq, unsigned int *count,
126 unsigned int *size) 126 unsigned int *size)
127{ 127{
128 struct soc_camera_device *icd = vq->priv_data; 128 struct soc_camera_device *icd = vq->priv_data;
129 int bytes_per_line = soc_mbus_bytes_per_line(icd->user_width,
130 icd->current_fmt->host_fmt);
131 129
132 if (bytes_per_line < 0) 130 *size = icd->sizeimage;
133 return bytes_per_line;
134
135 *size = bytes_per_line * icd->user_height;
136 131
137 if (!*count) 132 if (!*count)
138 *count = 32; 133 *count = 32;
@@ -171,11 +166,6 @@ static int mx1_videobuf_prepare(struct videobuf_queue *vq,
171 struct soc_camera_device *icd = vq->priv_data; 166 struct soc_camera_device *icd = vq->priv_data;
172 struct mx1_buffer *buf = container_of(vb, struct mx1_buffer, vb); 167 struct mx1_buffer *buf = container_of(vb, struct mx1_buffer, vb);
173 int ret; 168 int ret;
174 int bytes_per_line = soc_mbus_bytes_per_line(icd->user_width,
175 icd->current_fmt->host_fmt);
176
177 if (bytes_per_line < 0)
178 return bytes_per_line;
179 169
180 dev_dbg(icd->parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__, 170 dev_dbg(icd->parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
181 vb, vb->baddr, vb->bsize); 171 vb, vb->baddr, vb->bsize);
@@ -202,7 +192,7 @@ static int mx1_videobuf_prepare(struct videobuf_queue *vq,
202 vb->state = VIDEOBUF_NEEDS_INIT; 192 vb->state = VIDEOBUF_NEEDS_INIT;
203 } 193 }
204 194
205 vb->size = bytes_per_line * vb->height; 195 vb->size = icd->sizeimage;
206 if (0 != vb->baddr && vb->bsize < vb->size) { 196 if (0 != vb->baddr && vb->bsize < vb->size) {
207 ret = -EINVAL; 197 ret = -EINVAL;
208 goto out; 198 goto out;