Re: [PATCH] (2.6.7-rc1) ADB driver fails to create /dev/adb

From: Colin Leroy
Date: Tue May 25 2004 - 15:32:01 EST


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

Hi,

> 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).

--
Colin
--- drivers/macintosh/adb.c.orig 2004-05-25 21:08:10.000000000 +0200
+++ drivers/macintosh/adb.c 2004-05-25 22:27:04.596656712 +0200
@@ -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)) {