Skip to contentSkip to conversation

(2.6.7-rc1) ADB driver fails to create /dev/adb

PATCH In review Colin Leroy 1 participant 2 messages May 25, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 (2.6.7-rc1) ADB driver fails to create /dev/adb

Hi,

adb driver in 2.6.7-rc1 fails to create /dev/adb (noticed because pbbuttonsd complains and doesn't work).

I looked at the differences with 2.6.6's driver, and saw that the devfs bit was removed. Was there a reason for that, apart the fact that devfs is obsolete ?

Here's a patch that restores previous behaviour. (I bothered because I noticed lots of other drivers still using devfs_mk_cdev() and I think it should stay here for a bit more).

hth,

Signature · 1 line
Colin
macintosh/adb.c renamed from macintosh/adb.c.orig +3 -0
@@ -898,6 +898,9 @@
 {
 	if (register_chrdev(ADB_MAJOR, "adb", &adb_fops)) {
 		printk(KERN_ERR "adb: unable to get major %d\n", ADB_MAJOR);
+	} else if (devfs_mk_cdev(MKDEV(ADB_MAJOR, 0),
+				 S_IFCHR | S_IRUSR | S_IWUSR, "adb")) {
+		printk(KERN_ERR "adb: unable to make dev via devfs\n");
 		return;
 	}
 	adb_dev_class = class_simple_create(THIS_MODULE, "adb");
#1 lore raw

On 25 May 2004 at 21h05, Colin Leroy wrote:

Hi,

Quoted 3 lines

Here's a patch that restores previous behaviour. (I bothered because I noticed lots of other drivers still using devfs_mk_cdev() and I think it should stay here for a bit more).

Mmh, here's a nicer patch (forgot a return, and the else isn't the most clear).

Signature · 1 line
Colin
macintosh/adb.c renamed from macintosh/adb.c.orig +5 -0
@@ -899,6 +899,11 @@
 	if (register_chrdev(ADB_MAJOR, "adb", &adb_fops)) {
 		printk(KERN_ERR "adb: unable to get major %d\n", ADB_MAJOR);
 		return;
+	} 
+	if (devfs_mk_cdev(MKDEV(ADB_MAJOR, 0),
+				 S_IFCHR | S_IRUSR | S_IWUSR, "adb")) {
+		printk(KERN_ERR "adb: unable to make dev via devfs\n");
+		return;
 	}
 	adb_dev_class = class_simple_create(THIS_MODULE, "adb");
 	if (IS_ERR(adb_dev_class)) {