From: Stelian Pop <stelian@popies.net>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Linus Torvalds <torvalds@osdl.org>
Subject: [PATCH 2.6.0-test4] meye driver update
Date: Mon, 1 Sep 2003 17:13:07 +0200 [thread overview]
Message-ID: <20030901151307.GC27269@deep-space-9.dsnet> (raw)
Hi,
The attached patch implements the needed 'release' callback in order
to make videodev/sysfs happy again.
Linus, please apply.
Thanks,
Stelian.
===== drivers/media/video/meye.h 1.8 vs edited =====
--- 1.8/drivers/media/video/meye.h Wed Apr 16 12:01:38 2003
+++ edited/drivers/media/video/meye.h Tue Aug 26 16:48:06 2003
@@ -312,7 +312,7 @@
struct meye_queue grabq; /* queue for buffers to be grabbed */
- struct video_device video_dev; /* video device parameters */
+ struct video_device *video_dev; /* video device parameters */
struct video_picture picture; /* video picture parameters */
struct meye_params params; /* additional parameters */
#ifdef CONFIG_PM
===== drivers/media/video/meye.c 1.18 vs edited =====
--- 1.18/drivers/media/video/meye.c Thu Jul 31 17:59:04 2003
+++ edited/drivers/media/video/meye.c Wed Aug 27 11:24:51 2003
@@ -920,7 +920,7 @@
case VIDIOCGCAP: {
struct video_capability *b = arg;
- strcpy(b->name,meye.video_dev.name);
+ strcpy(b->name,meye.video_dev->name);
b->type = VID_TYPE_CAPTURE;
b->channels = 1;
b->audios = 0;
@@ -1225,6 +1225,8 @@
.type = VID_TYPE_CAPTURE,
.hardware = VID_HARDWARE_MEYE,
.fops = &meye_fops,
+ .release = video_device_release,
+ .minor = -1,
};
#ifdef CONFIG_PM
@@ -1275,10 +1277,17 @@
goto out1;
}
- sonypi_camera_command(SONYPI_COMMAND_SETCAMERA, 1);
-
meye.mchip_dev = pcidev;
- memcpy(&meye.video_dev, &meye_template, sizeof(meye_template));
+ meye.video_dev = video_device_alloc();
+ if (!meye.video_dev) {
+ printk(KERN_ERR "meye: video_device_alloc() failed!\n");
+ ret = -EBUSY;
+ goto out1;
+ }
+ memcpy(meye.video_dev, &meye_template, sizeof(meye_template));
+ meye.video_dev->dev = &meye.mchip_dev->dev;
+
+ sonypi_camera_command(SONYPI_COMMAND_SETCAMERA, 1);
if ((ret = pci_enable_device(meye.mchip_dev))) {
printk(KERN_ERR "meye: pci_enable_device failed\n");
@@ -1335,7 +1344,7 @@
wait_ms(1);
mchip_set(MCHIP_MM_INTA, MCHIP_MM_INTA_HIC_1_MASK);
- if (video_register_device(&meye.video_dev, VFL_TYPE_GRABBER, video_nr) < 0) {
+ if (video_register_device(meye.video_dev, VFL_TYPE_GRABBER, video_nr) < 0) {
printk(KERN_ERR "meye: video_register_device failed\n");
ret = -EIO;
@@ -1383,6 +1392,9 @@
out3:
pci_disable_device(meye.mchip_dev);
out2:
+ video_device_release(meye.video_dev);
+ meye.video_dev = NULL;
+
sonypi_camera_command(SONYPI_COMMAND_SETCAMERA, 0);
out1:
return ret;
@@ -1390,7 +1402,7 @@
static void __devexit meye_remove(struct pci_dev *pcidev) {
- video_unregister_device(&meye.video_dev);
+ video_unregister_device(meye.video_dev);
mchip_hic_stop();
--
Stelian Pop <stelian@popies.net>
next reply other threads:[~2003-09-01 15:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-01 15:13 Stelian Pop [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-08-26 14:17 Stelian Pop
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030901151307.GC27269@deep-space-9.dsnet \
--to=stelian@popies.net \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®