On Fri, Mar 25, 2005 at 08:25:08PM +0000, Russell King wrote: > Eh? How do you end up with "/sys/devices/platform/foobar0.0" for the > former case? It has an ID of "-1", and not zero. Your idea doesn't > make any sense. > Yes, I missed the -1 part, so Kyle is correct. It would be trivial to treat them both as foobar0 and have the registration succeed for whoever gets it first, but I could see that this would be problematic in the serial8250 case. On the other hand, this is then serial8250's problem. > > The first case is a corner case, and really shouldn't happen that much in > > practice outside of broken drivers. > > It does happen today. Firstly, the 8250 driver registers a device of > "serial8250" with id = -1 for the backwards-compatible devices. > Platforms can then register a platform device called "serial8250" > with zero or positive id numbers. > That's fine, but that still doesn't make it any less of a corner case. > > We don't go around changing /dev semantics everytime someone decides to > > call their device something silly, I don't see why platform devices > > should be treated differently, better to just fix the broken drivers.. > > It's not about something being called something silly. It's about > the original concept of how to generate the path being down right > stupid. > <dev><id> is a fairly common thing, if you have a problem with this, maybe you would like to audit /dev while you are at it. I don't disagree with you that this is useful for the devices that do end with numbers in their names, but breaking everything else as a result of this makes no sense either. What would you do if you needed to register a character device using the name of the device (which may end in a number, and there was a range of them)? This likely doesn't happen enough in practice for anyone to actually care, but you would have the same problem there otherwise. This should arguably be the problem of the corner case driver, it certainly shouldn't change convention for everyone else. While the original concept of how to generate the path may have been "down right stupid", it works for /dev, and I don't see how adding a superfluous . in the paths of devices that just don't care and subsequently breaking existing expectations of behaviour is any more inspired..
Attachment:
pgpgWseFQta16.pgp
Description: PGP signature
- Follow-Ups:
- References:
- Re: [PATCH] driver core: Separate platform device name from platform device number
- From: Paul Mundt <[email protected]>
- Re: [PATCH] driver core: Separate platform device name from platform device number
- From: Greg KH <[email protected]>
- Re: [PATCH] driver core: Separate platform device name from platform device number
- From: Paul Mundt <[email protected]>
- Re: [PATCH] driver core: Separate platform device name from platform device number
- From: Kyle Moffett <[email protected]>
- Re: [PATCH] driver core: Separate platform device name from platform device number
- From: Paul Mundt <[email protected]>
- Re: [PATCH] driver core: Separate platform device name from platform device number
- From: Russell King <[email protected]>
- Re: [PATCH] driver core: Separate platform device name from platform device number
- Prev by Date: Re: OOPS running "ls -l /sys/class/i2c-adapter/*"-- 2.6.12-rc1-mm2
- Next by Date: Re: [PATCH][0/5] cifs: cifsfs.c cleanup
- Previous by thread: Re: [PATCH] driver core: Separate platform device name from platform device number
- Next by thread: Re: [PATCH] driver core: Separate platform device name from platform device number
- Index(es):