Re: [PATCH] alternative dev patch

From: Roman Zippel (zippel@linux-m68k.org)
Date: Sun Mar 23 2003 - 10:05:24 EST


Hi,

On Sun, 23 Mar 2003, Greg KH wrote:

> > There are a few options:
> > 1. Drivers can implement that themselves:
>
> Yeah, but as I know, it's a big pain in the butt. Let's make it easy to
> do this, don't make writing a driver tougher than it has to be (it's
> already much harder than it used to be.) Andries's patch makes it easy,
> which is a good thing in my book.

Andries' patch doesn't help at all and only makes things worse. Only very
few drivers should have to deal with the major/minor business. Most
drivers should just do add_serial_device/add_tape_device/... and these
function will do the right thing (e.g. announce the new device via sysfs).

> > register_usb_device(...)
> > {
> > ...
> > cdev = cdget(dev);
> > down(&cdev->sem);
> > if (cdev->fops)
> > ...;
> > cdev->fops = fops;
> > up(&cdev->sem);
> > }
> > (see the misc driver again for a detailed example.)
>
> Look at drivers/usb/core/file.c::usb_open(), it does much the same
> thing. Well, functionally the same, not identical in any way :)

No, with my patch usb_open() and usb_minors[] could go away completely,
you just setup everything in usb_register_dev() and the rest is done for
you.
With Andries' patch you will not get rid of this.

bye, Roman

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Mar 23 2003 - 22:00:44 EST