All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] 2.6.11-rc2-bk2 DVB fixes
@ 2005-01-25  0:31 Johannes Stezenbach
  2005-01-25  0:31 ` [PATCH 1/4] follow USB __le16 changes Johannes Stezenbach
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Johannes Stezenbach @ 2005-01-25  0:31 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, js

Hi Linus,

the following patches correct a few bugs which were found
shortly after submission of the previous patchset :-(
(except 03-core-more-cards which I just submit while I'm at it)

01-dibusb-le16		follow USB __le16 changes
02-core-fe-release	fix access to freed memory on module unload
03-core-more-cards	support up to six DVB cards (instead of just four)
04-frontends		cleanup some confusing firmware loading printks

I also saw that there is a large amount of whitespace/indentation
corruption throughout the DVB subsystem (some of it shows through
in the 04-frontends patch), which was not introduced
by the latest patchset but already exists in linux-2.6.10-rc2 at least.
I will try to sort this out over the next few days.

Johannes


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/4] follow USB __le16 changes
  2005-01-25  0:31 [PATCH 0/4] 2.6.11-rc2-bk2 DVB fixes Johannes Stezenbach
@ 2005-01-25  0:31 ` Johannes Stezenbach
  2005-01-25  0:31 ` [PATCH 2/4] fix access to freed memory Johannes Stezenbach
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Johannes Stezenbach @ 2005-01-25  0:31 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, js

- [DVB] dibusb: follow USB changes (idVendor, idProduct, bcdDevice
  and bcdUSB fields are now __le16)

Signed-off-by: Johannes Stezenbach <js@linuxtv.org>

diff -rupN linux-2.6.11-rc2-mm1/drivers/media/dvb/dibusb/dvb-dibusb-core.c linux-2.6.11-rc2-mm1-dvb/drivers/media/dvb/dibusb/dvb-dibusb-core.c
--- linux-2.6.11-rc2-mm1/drivers/media/dvb/dibusb/dvb-dibusb-core.c	2005-01-24 23:31:05.000000000 +0100
+++ linux-2.6.11-rc2-mm1-dvb/drivers/media/dvb/dibusb/dvb-dibusb-core.c	2005-01-24 23:16:27.000000000 +0100
@@ -358,8 +360,8 @@ static struct dibusb_usb_device * dibusb
 	for (i = 0; i < sizeof(dibusb_devices)/sizeof(struct dibusb_usb_device); i++) {
 		for (j = 0; j < DIBUSB_ID_MAX_NUM && dibusb_devices[i].cold_ids[j] != NULL; j++) {
 			deb_info("check for cold %x %x\n",dibusb_devices[i].cold_ids[j]->idVendor, dibusb_devices[i].cold_ids[j]->idProduct);
-			if (dibusb_devices[i].cold_ids[j]->idVendor == udev->descriptor.idVendor &&
-				dibusb_devices[i].cold_ids[j]->idProduct == udev->descriptor.idProduct) {
+			if (dibusb_devices[i].cold_ids[j]->idVendor == le16_to_cpu(udev->descriptor.idVendor) &&
+				dibusb_devices[i].cold_ids[j]->idProduct == le16_to_cpu(udev->descriptor.idProduct)) {
 				*cold = 1;
 				return &dibusb_devices[i];
 			}
@@ -367,8 +369,8 @@ static struct dibusb_usb_device * dibusb
 
 		for (j = 0; j < DIBUSB_ID_MAX_NUM && dibusb_devices[i].warm_ids[j] != NULL; j++) {
 			deb_info("check for warm %x %x\n",dibusb_devices[i].warm_ids[j]->idVendor, dibusb_devices[i].warm_ids[j]->idProduct);
-			if (dibusb_devices[i].warm_ids[j]->idVendor == udev->descriptor.idVendor &&
-				dibusb_devices[i].warm_ids[j]->idProduct == udev->descriptor.idProduct) {
+			if (dibusb_devices[i].warm_ids[j]->idVendor == le16_to_cpu(udev->descriptor.idVendor) &&
+				dibusb_devices[i].warm_ids[j]->idProduct == le16_to_cpu(udev->descriptor.idProduct)) {
 				*cold = 0;
 				return &dibusb_devices[i];
 			}
@@ -391,7 +393,7 @@ static int dibusb_probe(struct usb_inter
 
 	if ((dibdev = dibusb_find_device(udev,&cold)) == NULL) {
 		err("something went very wrong, "
-				"unknown product ID: %.4x",udev->descriptor.idProduct);
+				"unknown product ID: %.4x",le16_to_cpu(udev->descriptor.idProduct));
 		return -ENODEV;
 	}
 	


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/4] fix access to freed memory
  2005-01-25  0:31 [PATCH 0/4] 2.6.11-rc2-bk2 DVB fixes Johannes Stezenbach
  2005-01-25  0:31 ` [PATCH 1/4] follow USB __le16 changes Johannes Stezenbach
@ 2005-01-25  0:31 ` Johannes Stezenbach
  2005-01-25  0:31 ` [PATCH 3/4] support up to six DVB cards Johannes Stezenbach
  2005-01-25  0:31 ` [PATCH 4/4] cleanup firmware loading printks Johannes Stezenbach
  3 siblings, 0 replies; 5+ messages in thread
From: Johannes Stezenbach @ 2005-01-25  0:31 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, js

- [DVB] core: fix access to freed memory when unloading frontend
  drivers (fix by Gerd Knorr)

Signed-off-by: Johannes Stezenbach <js@linuxtv.org>

diff -rupN linux-2.6.11-rc2-bk2/drivers/media/dvb/dvb-core/dvb_frontend.c linux-2.6.11-rc2-bk2-dvb/drivers/media/dvb/dvb-core/dvb_frontend.c
--- linux-2.6.11-rc2-bk2/drivers/media/dvb/dvb-core/dvb_frontend.c	2005-01-24 23:18:39.000000000 +0100
+++ linux-2.6.11-rc2-bk2-dvb/drivers/media/dvb/dvb-core/dvb_frontend.c	2005-01-25 00:17:56.000000000 +0100
@@ -912,8 +912,9 @@ int dvb_unregister_frontend(struct dvb_f
 		fe->ops->release(fe);
 	else
 		printk("dvb_frontend: Demodulator (%s) does not have a release callback!\n", fe->ops->info.name);
-	if (fe->frontend_priv)
-		kfree(fe->frontend_priv);
+	/* fe is invalid now */
+	if (fepriv)
+		kfree(fepriv);
 	up (&frontend_mutex);
 	return 0;
 }


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 3/4] support up to six DVB cards
  2005-01-25  0:31 [PATCH 0/4] 2.6.11-rc2-bk2 DVB fixes Johannes Stezenbach
  2005-01-25  0:31 ` [PATCH 1/4] follow USB __le16 changes Johannes Stezenbach
  2005-01-25  0:31 ` [PATCH 2/4] fix access to freed memory Johannes Stezenbach
@ 2005-01-25  0:31 ` Johannes Stezenbach
  2005-01-25  0:31 ` [PATCH 4/4] cleanup firmware loading printks Johannes Stezenbach
  3 siblings, 0 replies; 5+ messages in thread
From: Johannes Stezenbach @ 2005-01-25  0:31 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, js

- [DVB] core: add support for up to six DVB cards by using
  32bit dev_t capabilities

Signed-off-by: Johannes Stezenbach <js@linuxtv.org>

--- linux-2.6.11-rc2-bk2/drivers/media/dvb/dvb-core/dvbdev.c	2004-12-24 22:34:26.000000000 +0100
+++ linux-2.6.11-rc2-bk2-dvb/drivers/media/dvb/dvb-core/dvbdev.c	2005-01-25 00:35:45.000000000 +0100
@@ -31,6 +31,8 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/device.h>
+#include <linux/fs.h>
+#include <linux/cdev.h>
 
 #include "dvbdev.h"
 
@@ -50,8 +52,9 @@ static const char * const dnames[] = {
 };
 
 
-#define DVB_MAX_IDS              4
+#define DVB_MAX_IDS              6
 #define nums2minor(num,type,id)  ((num << 6) | (id << 4) | type)
+#define MAX_DVB_MINORS           (DVB_MAX_IDS*64)
 
 struct class_simple *dvb_class;
 EXPORT_SYMBOL(dvb_class);
@@ -109,6 +112,11 @@ static struct file_operations dvb_device
 };
 
 
+static struct cdev dvb_device_cdev = {
+	.kobj   = {.name = "dvb", },
+	.owner  =       THIS_MODULE,
+};
+
 int dvb_generic_open(struct inode *inode, struct file *file)
 {
         struct dvb_device *dvbdev = file->private_data;
@@ -400,25 +408,41 @@ out:
 static int __init init_dvbdev(void)
 {
 	int retval;
+	dev_t dev = MKDEV(DVB_MAJOR, 0);
+
+	if ((retval = register_chrdev_region(dev, MAX_DVB_MINORS, "DVB")) != 0) {
+		printk("dvb-core: unable to get major %d\n", DVB_MAJOR);
+		return retval;
+	}
 
-	if ((retval = register_chrdev(DVB_MAJOR,"DVB", &dvb_device_fops)))
+	cdev_init(&dvb_device_cdev, &dvb_device_fops);
+	if ((retval = cdev_add(&dvb_device_cdev, dev, MAX_DVB_MINORS)) != 0) {
 		printk("dvb-core: unable to get major %d\n", DVB_MAJOR);
+		goto error;
+	}
 
 	devfs_mk_dir("dvb");
 
 	dvb_class = class_simple_create(THIS_MODULE, "dvb");
-	if (IS_ERR(dvb_class))
-		return PTR_ERR(dvb_class);
+	if (IS_ERR(dvb_class)) {
+		retval = PTR_ERR(dvb_class);
+		goto error;
+	}
+	return 0;
 
+error:
+	cdev_del(&dvb_device_cdev);
+	unregister_chrdev_region(dev, MAX_DVB_MINORS);
 	return retval;
 }
 
 
 static void __exit exit_dvbdev(void)
 {
-	unregister_chrdev(DVB_MAJOR, "DVB");
         devfs_remove("dvb");
 	class_simple_destroy(dvb_class);
+	cdev_del(&dvb_device_cdev);
+        unregister_chrdev_region(MKDEV(DVB_MAJOR, 0), MAX_DVB_MINORS);
 }
 
 module_init(init_dvbdev);


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 4/4] cleanup firmware loading printks
  2005-01-25  0:31 [PATCH 0/4] 2.6.11-rc2-bk2 DVB fixes Johannes Stezenbach
                   ` (2 preceding siblings ...)
  2005-01-25  0:31 ` [PATCH 3/4] support up to six DVB cards Johannes Stezenbach
@ 2005-01-25  0:31 ` Johannes Stezenbach
  3 siblings, 0 replies; 5+ messages in thread
From: Johannes Stezenbach @ 2005-01-25  0:31 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, js

- [DVB] frontends: sp887x: improve confusing firmware loading messages

Signed-off-by: Johannes Stezenbach <js@linuxtv.org>

diff -rupN linux-2.6.11-rc2-bk2/drivers/media/dvb/frontends/sp8870.c linux-2.6.11-rc2-bk2-dvb/drivers/media/dvb/frontends/sp8870.c
--- linux-2.6.11-rc2-bk2/drivers/media/dvb/frontends/sp8870.c	2004-12-24 22:35:40.000000000 +0100
+++ linux-2.6.11-rc2-bk2-dvb/drivers/media/dvb/frontends/sp8870.c	2005-01-25 00:40:10.000000000 +0100
@@ -313,7 +313,7 @@ static int sp8870_init (struct dvb_front
 
 
 	/* request the firmware, this will block until someone uploads it */
-	printk("sp8870: waiting for firmware upload...\n");
+	printk("sp8870: waiting for firmware upload (%s)...\n", SP8870_DEFAULT_FIRMWARE);
 	if (state->config->request_firmware(fe, &fw, SP8870_DEFAULT_FIRMWARE)) {
 		printk("sp8870: no firmware upload (timeout or file not found?)\n");
 		release_firmware(fw);
@@ -325,6 +325,7 @@ static int sp8870_init (struct dvb_front
 		release_firmware(fw);
 		return -EIO;
 	}
+	printk("sp8870: firmware upload complete\n");
 
 	/* enable TS output and interface pins */
 	sp8870_writereg(state, 0xc18, 0x00d);
diff -rupN linux-2.6.11-rc2-bk2/drivers/media/dvb/frontends/sp887x.c linux-2.6.11-rc2-bk2-dvb/drivers/media/dvb/frontends/sp887x.c
--- linux-2.6.11-rc2-bk2/drivers/media/dvb/frontends/sp887x.c	2004-12-24 22:35:24.000000000 +0100
+++ linux-2.6.11-rc2-bk2-dvb/drivers/media/dvb/frontends/sp887x.c	2005-01-25 00:41:31.000000000 +0100
@@ -518,7 +518,7 @@ static int sp887x_init(struct dvb_fronte
 
 	if (!state->initialised) {
 	/* request the firmware, this will block until someone uploads it */
-	printk("sp887x: waiting for firmware upload...\n");
+		printk("sp887x: waiting for firmware upload (%s)...\n", SP887X_DEFAULT_FIRMWARE);
 		ret = state->config->request_firmware(fe, &fw, SP887X_DEFAULT_FIRMWARE);
 	if (ret) {
 		printk("sp887x: no firmware upload (timeout or file not found?)\n");
@@ -531,6 +531,7 @@ static int sp887x_init(struct dvb_fronte
 			release_firmware(fw);
 			return ret;
 	}
+		printk("sp887x: firmware upload complete\n");
 		state->initialised = 1;
 	}
 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-01-25  0:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-25  0:31 [PATCH 0/4] 2.6.11-rc2-bk2 DVB fixes Johannes Stezenbach
2005-01-25  0:31 ` [PATCH 1/4] follow USB __le16 changes Johannes Stezenbach
2005-01-25  0:31 ` [PATCH 2/4] fix access to freed memory Johannes Stezenbach
2005-01-25  0:31 ` [PATCH 3/4] support up to six DVB cards Johannes Stezenbach
2005-01-25  0:31 ` [PATCH 4/4] cleanup firmware loading printks Johannes Stezenbach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.