Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6

* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6:
[media] V4L: soc-camera: regression fix: calculate .sizeimage in soc_camera.c
[media] v4l2-subdev: fix broken subdev control enumeration
[media] Fix cx88 remote control input
[media] v4l: Release module if subdev registration fails

+54 -15
+1 -1
drivers/media/video/cx88/cx88-input.c
··· 524 524 for (todo = 32; todo > 0; todo -= bits) { 525 525 ev.pulse = samples & 0x80000000 ? false : true; 526 526 bits = min(todo, 32U - fls(ev.pulse ? samples : ~samples)); 527 - ev.duration = (bits * NSEC_PER_SEC) / (1000 * ir_samplerate); 527 + ev.duration = (bits * (NSEC_PER_SEC / 1000)) / ir_samplerate; 528 528 ir_raw_event_store_with_filter(ir->dev, &ev); 529 529 samples <<= bits; 530 530 }
+42 -6
drivers/media/video/soc_camera.c
··· 136 136 } 137 137 EXPORT_SYMBOL(soc_camera_apply_sensor_flags); 138 138 139 + #define pixfmtstr(x) (x) & 0xff, ((x) >> 8) & 0xff, ((x) >> 16) & 0xff, \ 140 + ((x) >> 24) & 0xff 141 + 142 + static int soc_camera_try_fmt(struct soc_camera_device *icd, 143 + struct v4l2_format *f) 144 + { 145 + struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 146 + struct v4l2_pix_format *pix = &f->fmt.pix; 147 + int ret; 148 + 149 + dev_dbg(&icd->dev, "TRY_FMT(%c%c%c%c, %ux%u)\n", 150 + pixfmtstr(pix->pixelformat), pix->width, pix->height); 151 + 152 + pix->bytesperline = 0; 153 + pix->sizeimage = 0; 154 + 155 + ret = ici->ops->try_fmt(icd, f); 156 + if (ret < 0) 157 + return ret; 158 + 159 + if (!pix->sizeimage) { 160 + if (!pix->bytesperline) { 161 + const struct soc_camera_format_xlate *xlate; 162 + 163 + xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat); 164 + if (!xlate) 165 + return -EINVAL; 166 + 167 + ret = soc_mbus_bytes_per_line(pix->width, 168 + xlate->host_fmt); 169 + if (ret > 0) 170 + pix->bytesperline = ret; 171 + } 172 + if (pix->bytesperline) 173 + pix->sizeimage = pix->bytesperline * pix->height; 174 + } 175 + 176 + return 0; 177 + } 178 + 139 179 static int soc_camera_try_fmt_vid_cap(struct file *file, void *priv, 140 180 struct v4l2_format *f) 141 181 { 142 182 struct soc_camera_device *icd = file->private_data; 143 - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 144 183 145 184 WARN_ON(priv != file->private_data); 146 185 ··· 188 149 return -EINVAL; 189 150 190 151 /* limit format to hardware capabilities */ 191 - return ici->ops->try_fmt(icd, f); 152 + return soc_camera_try_fmt(icd, f); 192 153 } 193 154 194 155 static int soc_camera_enum_input(struct file *file, void *priv, ··· 401 362 icd->user_formats = NULL; 402 363 } 403 364 404 - #define pixfmtstr(x) (x) & 0xff, ((x) >> 8) & 0xff, ((x) >> 16) & 0xff, \ 405 - ((x) >> 24) & 0xff 406 - 407 365 /* Called with .vb_lock held, or from the first open(2), see comment there */ 408 366 static int soc_camera_set_fmt(struct soc_camera_device *icd, 409 367 struct v4l2_format *f) ··· 413 377 pixfmtstr(pix->pixelformat), pix->width, pix->height); 414 378 415 379 /* We always call try_fmt() before set_fmt() or set_crop() */ 416 - ret = ici->ops->try_fmt(icd, f); 380 + ret = soc_camera_try_fmt(icd, f); 417 381 if (ret < 0) 418 382 return ret; 419 383
+4 -1
drivers/media/video/v4l2-device.c
··· 155 155 sd->v4l2_dev = v4l2_dev; 156 156 if (sd->internal_ops && sd->internal_ops->registered) { 157 157 err = sd->internal_ops->registered(sd); 158 - if (err) 158 + if (err) { 159 + module_put(sd->owner); 159 160 return err; 161 + } 160 162 } 161 163 162 164 /* This just returns 0 if either of the two args is NULL */ ··· 166 164 if (err) { 167 165 if (sd->internal_ops && sd->internal_ops->unregistered) 168 166 sd->internal_ops->unregistered(sd); 167 + module_put(sd->owner); 169 168 return err; 170 169 } 171 170
+7 -7
drivers/media/video/v4l2-subdev.c
··· 155 155 156 156 switch (cmd) { 157 157 case VIDIOC_QUERYCTRL: 158 - return v4l2_subdev_queryctrl(sd, arg); 158 + return v4l2_queryctrl(sd->ctrl_handler, arg); 159 159 160 160 case VIDIOC_QUERYMENU: 161 - return v4l2_subdev_querymenu(sd, arg); 161 + return v4l2_querymenu(sd->ctrl_handler, arg); 162 162 163 163 case VIDIOC_G_CTRL: 164 - return v4l2_subdev_g_ctrl(sd, arg); 164 + return v4l2_g_ctrl(sd->ctrl_handler, arg); 165 165 166 166 case VIDIOC_S_CTRL: 167 - return v4l2_subdev_s_ctrl(sd, arg); 167 + return v4l2_s_ctrl(sd->ctrl_handler, arg); 168 168 169 169 case VIDIOC_G_EXT_CTRLS: 170 - return v4l2_subdev_g_ext_ctrls(sd, arg); 170 + return v4l2_g_ext_ctrls(sd->ctrl_handler, arg); 171 171 172 172 case VIDIOC_S_EXT_CTRLS: 173 - return v4l2_subdev_s_ext_ctrls(sd, arg); 173 + return v4l2_s_ext_ctrls(sd->ctrl_handler, arg); 174 174 175 175 case VIDIOC_TRY_EXT_CTRLS: 176 - return v4l2_subdev_try_ext_ctrls(sd, arg); 176 + return v4l2_try_ext_ctrls(sd->ctrl_handler, arg); 177 177 178 178 case VIDIOC_DQEVENT: 179 179 if (!(sd->flags & V4L2_SUBDEV_FL_HAS_EVENTS))