Re: dazuko 2.1.0-pre7 doesn't work under 2.6.13-rc6

Dirk Vornheder <[email protected]>
Newsgroups gmane.linux.dazuko.devel
Message-ID <[email protected]>
> > dazuko 2.1.0-pre7 doesn't work under 2.6.13-rc6:
> >
> > /privat/kernel/dazuko-2.1.0-pre7/dazuko_linux26.c:976: warning: implicit
> > declaration of function `class_simple_destroy'
> >   LD [M]  /privat/kernel/dazuko-2.1.0-pre7/dazuko.o
> >   Building modules, stage 2.
> >   MODPOST
> > *** Warning:
> > "class_simple_create" [/privat/kernel/dazuko-2.1.0-pre7/dazuko.ko]
> > undefined! *** Warning:
> > "class_simple_device_remove" [/privat/kernel/dazuko-2.1.0-pre7/dazuko.ko]
> > undefined!
> > *** Warning:
> > "class_simple_destroy" [/privat/kernel/dazuko-2.1.0-pre7/dazuko.ko]
> > undefined!
> > *** Warning:
> > "class_simple_device_add" [/privat/kernel/dazuko-2.1.0-pre7/dazuko.ko]
> > undefined!
> >   CC      /privat/kernel/dazuko-2.1.0-pre7/dazuko.mod.o
> >   LD [M]  /privat/kernel/dazuko-2.1.0-pre7/dazuko.ko
> > make[1]: Leaving directory `/privat/kernel/linux-2.6.13-rc5'
> > touch dummy_rule
>
> disclaimer: I don't speak for my employer here, I have my own mind
>
> I don't know what drove the people to rename a struct every(!) driver
> for Linux 2.6 needs.  In the middle of a 2.6 line.  There is no reason
> to see what made this necessary, I hope it was not boredom ... :(  And
> on top it would have rang alarm bells in my mind to use a name like
> "class" for a struct.  What are these people smoking?
>
>
> background: "somebody" renamed "struct simple_class" to "struct class"
> and changed the function names to allocate and release this data
> structure (without changing the interface at all).
>
> You need to change the variable declaration and the associated
> function calls in dazuko_linux26.c.  This makes Dazuko compile again
> against 2.6.13 kernels.  Of couse it breaks builds on kernels up to
> 2.6.12.  So we end up with another #ifdef case.  Great job!
>
>
> Can somebody closer to the Linux kernel development tell what was the
> reason for this nonsense change?  Which breaks every third party
> driver out there for no obvious reason.  While gaining absolutely
> nothing.  I'm really curious ...
>
>
> --- dazuko_linux26.c
> +++ dazuko_linux26.c	2005/08/05 12:20:01
> @@ -49,7 +49,7 @@
>  int linux_dazuko_device_ioctl(struct inode *inode, struct file *file,
> unsigned int cmd, unsigned long param); int
> linux_dazuko_device_release(struct inode *, struct file *);
>
> -static struct class_simple *dazuko_class = NULL;
> +static struct class *dazuko_class = NULL;
>
>  static struct vfsmount  *orig_rootmnt = NULL;
>  static struct dentry    *orig_root = NULL;
> @@ -960,8 +960,8 @@
>
>  	devfs_mk_cdev(MKDEV(dev_major, 0), S_IFCHR | S_IRUSR | S_IWUSR,
> DEVICE_NAME);
>
> -	dazuko_class = class_simple_create(THIS_MODULE, "dazuko");
> -	class_simple_device_add(dazuko_class, MKDEV(dev_major, 0), NULL,
> "dazuko"); +	dazuko_class = class_create(THIS_MODULE, "dazuko");
> +	class_device_create(dazuko_class, MKDEV(dev_major, 0), NULL, "dazuko");
>
>  	return 0;
>  }
> @@ -972,8 +972,8 @@
>
>  	devfs_remove(DEVICE_NAME);
>
> -	class_simple_device_remove(MKDEV(dev_major, 0));
> -	class_simple_destroy(dazuko_class);
> +	class_device_destroy(dazuko_class, MKDEV(dev_major, 0));
> +	class_destroy(dazuko_class);
>
>  #ifndef DAZUKO_FIST
>  #ifdef NO_STACKING_SUPPORT
>
>
> virtually yours                                     Gerhard Sittig
> pgp fingerprint AF29 3CD2 A531 F5A8 5F42  CB9A 1B7F 59F8 BA7A 9EE5

The patch works.

Thanks,

Dirk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.