Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 23 Mar 2003 09:54:29 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 23 Mar 2003 09:54:29 -0500 Received: from smtpzilla3.xs4all.nl ([194.109.127.139]:59661 "EHLO smtpzilla3.xs4all.nl") by vger.kernel.org with ESMTP id ; Sun, 23 Mar 2003 09:54:28 -0500 Date: Sun, 23 Mar 2003 16:05:24 +0100 (CET) From: Roman Zippel X-X-Sender: roman@serv To: Greg KH cc: Andries.Brouwer@cwi.nl, , Subject: Re: [PATCH] alternative dev patch In-Reply-To: <20030323081956.GK26145@kroah.com> Message-ID: References: <20030321012455.GB10298@kroah.com> <20030322013800.GD18835@kroah.com> <20030323081956.GK26145@kroah.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1499 Lines: 44 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/