The patch number 14857 was added via Douglas Schilling Landgraf
<[email protected]>
to http://linuxtv.org/hg/v4l-dvb master development tree.
Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel
If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List <[email protected]>
------
From: Hans Verkuil <[email protected]>
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.
Priority: normal
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Douglas Schilling Landgraf <[email protected]>
---
linux/drivers/media/common/saa7146_fops.c | 11 +++++------
linux/drivers/media/video/hexium_gemini.c | 3 ---
linux/drivers/media/video/hexium_orion.c | 4 ----
linux/drivers/media/video/mxb.c | 17 ++++++++---------
linux/include/media/saa7146_vv.h | 1 -
5 files changed, 13 insertions(+), 23 deletions(-)
diff -r 7dda50e31cde -r 2f5632eaf01d linux/drivers/media/common/saa7146_fops.c
--- a/linux/drivers/media/common/saa7146_fops.c Sun May 16 01:54:40 2010 -0300
+++ b/linux/drivers/media/common/saa7146_fops.c Sun May 16 01:57:40 2010 -0300
@@ -424,15 +424,14 @@
}
}
-int saa7146_vv_devinit(struct saa7146_dev *dev)
-{
- return v4l2_device_register(&dev->pci->dev, &dev->v4l2_dev);
-}
-EXPORT_SYMBOL_GPL(saa7146_vv_devinit);
-
int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv)
{
struct saa7146_vv *vv;
+ int err;
+
+ err = v4l2_device_register(&dev->pci->dev, &dev->v4l2_dev);
+ if (err)
+ return err;
vv = kzalloc(sizeof(struct saa7146_vv), GFP_KERNEL);
if (vv == NULL) {
diff -r 7dda50e31cde -r 2f5632eaf01d linux/drivers/media/video/hexium_gemini.c
--- a/linux/drivers/media/video/hexium_gemini.c Sun May 16 01:54:40 2010 -0300
+++ b/linux/drivers/media/video/hexium_gemini.c Sun May 16 01:57:40 2010 -0300
@@ -357,9 +357,6 @@
DEB_EE((".\n"));
- ret = saa7146_vv_devinit(dev);
- if (ret)
- return ret;
hexium = kzalloc(sizeof(struct hexium), GFP_KERNEL);
if (NULL == hexium) {
printk("hexium_gemini: not enough kernel memory in
hexium_attach().\n");
diff -r 7dda50e31cde -r 2f5632eaf01d linux/drivers/media/video/hexium_orion.c
--- a/linux/drivers/media/video/hexium_orion.c Sun May 16 01:54:40 2010 -0300
+++ b/linux/drivers/media/video/hexium_orion.c Sun May 16 01:57:40 2010 -0300
@@ -217,10 +217,6 @@
return -EFAULT;
}
- err = saa7146_vv_devinit(dev);
- if (err)
- return err;
-
hexium = kzalloc(sizeof(struct hexium), GFP_KERNEL);
if (NULL == hexium) {
printk("hexium_orion: hexium_probe: not enough kernel
memory.\n");
diff -r 7dda50e31cde -r 2f5632eaf01d linux/drivers/media/video/mxb.c
--- a/linux/drivers/media/video/mxb.c Sun May 16 01:54:40 2010 -0300
+++ b/linux/drivers/media/video/mxb.c Sun May 16 01:57:40 2010 -0300
@@ -170,11 +170,7 @@
static int mxb_probe(struct saa7146_dev *dev)
{
struct mxb *mxb = NULL;
- int err;
- err = saa7146_vv_devinit(dev);
- if (err)
- return err;
mxb = kzalloc(sizeof(struct mxb), GFP_KERNEL);
if (mxb == NULL) {
DEB_D(("not enough kernel memory.\n"));
@@ -703,14 +699,17 @@
/* this function only gets called when the probing was successful */
static int mxb_attach(struct saa7146_dev *dev, struct
saa7146_pci_extension_data *info)
{
- struct mxb *mxb = (struct mxb *)dev->ext_priv;
+ struct mxb *mxb;
DEB_EE(("dev:%p\n", dev));
- /* checking for i2c-devices can be omitted here, because we
- already did this in "mxb_vl42_probe" */
+ saa7146_vv_init(dev, &vv_data);
+ if (mxb_probe(dev)) {
+ saa7146_vv_release(dev);
+ return -1;
+ }
+ mxb = (struct mxb *)dev->ext_priv;
- saa7146_vv_init(dev, &vv_data);
vv_data.ops.vidioc_queryctrl = vidioc_queryctrl;
vv_data.ops.vidioc_g_ctrl = vidioc_g_ctrl;
vv_data.ops.vidioc_s_ctrl = vidioc_s_ctrl;
@@ -730,6 +729,7 @@
vv_data.ops.vidioc_default = vidioc_default;
if (saa7146_register_device(&mxb->video_dev, dev, "mxb",
VFL_TYPE_GRABBER)) {
ERR(("cannot register capture v4l2 device. skipping.\n"));
+ saa7146_vv_release(dev);
return -1;
}
@@ -850,7 +850,6 @@
.pci_tbl = &pci_tbl[0],
.module = THIS_MODULE,
- .probe = mxb_probe,
.attach = mxb_attach,
.detach = mxb_detach,
diff -r 7dda50e31cde -r 2f5632eaf01d linux/include/media/saa7146_vv.h
--- a/linux/include/media/saa7146_vv.h Sun May 16 01:54:40 2010 -0300
+++ b/linux/include/media/saa7146_vv.h Sun May 16 01:57:40 2010 -0300
@@ -188,7 +188,6 @@
void saa7146_dma_free(struct saa7146_dev* dev,struct videobuf_queue *q,
struct saa7146_buf *buf);
-int saa7146_vv_devinit(struct saa7146_dev *dev);
int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv);
int saa7146_vv_release(struct saa7146_dev* dev);
---
Patch is available at:
http://linuxtv.org/hg/v4l-dvb/rev/2f5632eaf01d4c17dc5028397ef5568d974febbf
_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits