Date: | 2010-03-24 23:09:55 (13 years 6 months ago) |
---|---|
Author: | Hans Verkuil |
Commit: | 03b1930efd3c2320b1dcba76c8af15f7e454919d |
Message: | V4L/DVB: saa7146: fix regression of the av7110/budget-av driver An earlier regression fix for the mxb driver (V4L/DVB: saa7146_vv: fix regression where v4l2_device was registered too late) caused a new regression in the av7110 driver. Reverted the old fix and fixed the problem in the mxb driver instead. Tested on mxb and budget-av cards. The real problem is that the saa7146 framework has separate probe() and attach() driver callbacks which should be rolled into one. This is now done for the mxb driver, but others should do the same. Lack of hardware makes this hard to do, though. I hope to get hold of some hexium cards and then I can try to improve the framework to prevent this from happening again. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> |
Files: |
drivers/media/common/saa7146_fops.c (1 diff) drivers/media/video/hexium_gemini.c (1 diff) drivers/media/video/hexium_orion.c (1 diff) drivers/media/video/mxb.c (4 diffs) include/media/saa7146_vv.h (1 diff) |
Change Details
drivers/media/common/saa7146_fops.c | ||
---|---|---|
423 | 423 | } |
424 | 424 | } |
425 | 425 | |
426 | int saa7146_vv_devinit(struct saa7146_dev *dev) | |
427 | { | |
428 | return v4l2_device_register(&dev->pci->dev, &dev->v4l2_dev); | |
429 | } | |
430 | EXPORT_SYMBOL_GPL(saa7146_vv_devinit); | |
431 | ||
432 | 426 | int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv) |
433 | 427 | { |
434 | 428 | struct saa7146_vv *vv; |
429 | int err; | |
430 | ||
431 | err = v4l2_device_register(&dev->pci->dev, &dev->v4l2_dev); | |
432 | if (err) | |
433 | return err; | |
435 | 434 | |
436 | 435 | vv = kzalloc(sizeof(struct saa7146_vv), GFP_KERNEL); |
437 | 436 | if (vv == NULL) { |
drivers/media/video/hexium_gemini.c | ||
---|---|---|
356 | 356 | |
357 | 357 | DEB_EE((".\n")); |
358 | 358 | |
359 | ret = saa7146_vv_devinit(dev); | |
360 | if (ret) | |
361 | return ret; | |
362 | 359 | hexium = kzalloc(sizeof(struct hexium), GFP_KERNEL); |
363 | 360 | if (NULL == hexium) { |
364 | 361 | printk("hexium_gemini: not enough kernel memory in hexium_attach().\n"); |
drivers/media/video/hexium_orion.c | ||
---|---|---|
216 | 216 | return -EFAULT; |
217 | 217 | } |
218 | 218 | |
219 | err = saa7146_vv_devinit(dev); | |
220 | if (err) | |
221 | return err; | |
222 | ||
223 | 219 | hexium = kzalloc(sizeof(struct hexium), GFP_KERNEL); |
224 | 220 | if (NULL == hexium) { |
225 | 221 | printk("hexium_orion: hexium_probe: not enough kernel memory.\n"); |
drivers/media/video/mxb.c | ||
---|---|---|
169 | 169 | static int mxb_probe(struct saa7146_dev *dev) |
170 | 170 | { |
171 | 171 | struct mxb *mxb = NULL; |
172 | int err; | |
173 | 172 | |
174 | err = saa7146_vv_devinit(dev); | |
175 | if (err) | |
176 | return err; | |
177 | 173 | mxb = kzalloc(sizeof(struct mxb), GFP_KERNEL); |
178 | 174 | if (mxb == NULL) { |
179 | 175 | DEB_D(("not enough kernel memory.\n")); |
... | ... | |
699 | 695 | /* this function only gets called when the probing was successful */ |
700 | 696 | static int mxb_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_data *info) |
701 | 697 | { |
702 | struct mxb *mxb = (struct mxb *)dev->ext_priv; | |
698 | struct mxb *mxb; | |
703 | 699 | |
704 | 700 | DEB_EE(("dev:%p\n", dev)); |
705 | 701 | |
706 | /* checking for i2c-devices can be omitted here, because we | |
707 | already did this in "mxb_vl42_probe" */ | |
708 | ||
709 | 702 | saa7146_vv_init(dev, &vv_data); |
703 | if (mxb_probe(dev)) { | |
704 | saa7146_vv_release(dev); | |
705 | return -1; | |
706 | } | |
707 | mxb = (struct mxb *)dev->ext_priv; | |
708 | ||
710 | 709 | vv_data.ops.vidioc_queryctrl = vidioc_queryctrl; |
711 | 710 | vv_data.ops.vidioc_g_ctrl = vidioc_g_ctrl; |
712 | 711 | vv_data.ops.vidioc_s_ctrl = vidioc_s_ctrl; |
... | ... | |
726 | 725 | vv_data.ops.vidioc_default = vidioc_default; |
727 | 726 | if (saa7146_register_device(&mxb->video_dev, dev, "mxb", VFL_TYPE_GRABBER)) { |
728 | 727 | ERR(("cannot register capture v4l2 device. skipping.\n")); |
728 | saa7146_vv_release(dev); | |
729 | 729 | return -1; |
730 | 730 | } |
731 | 731 | |
... | ... | |
846 | 846 | .pci_tbl = &pci_tbl[0], |
847 | 847 | .module = THIS_MODULE, |
848 | 848 | |
849 | .probe = mxb_probe, | |
850 | 849 | .attach = mxb_attach, |
851 | 850 | .detach = mxb_detach, |
852 | 851 |
include/media/saa7146_vv.h | ||
---|---|---|
188 | 188 | void saa7146_dma_free(struct saa7146_dev* dev,struct videobuf_queue *q, |
189 | 189 | struct saa7146_buf *buf); |
190 | 190 | |
191 | int saa7146_vv_devinit(struct saa7146_dev *dev); | |
192 | 191 | int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv); |
193 | 192 | int saa7146_vv_release(struct saa7146_dev* dev); |
194 | 193 |
Branches:
ben-wpan
ben-wpan-stefan
5396a9238205f20f811ea57898980d3ca82df0b6
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9