Platform device id

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Greg KH <gregkh@...>
Cc: LKML <linux-kernel@...>, David Brownell <david-b@...>
Date: Friday, September 7, 2007 - 9:35 am

Hi Greg, all,

While platform_device.id is a u32, platform_device_add() handles "-1" as
a special id value. This has potential for confusion and bugs. One such
bug was reported to me by David Brownell:

http://lists.lm-sensors.org/pipermail/i2c/2007-September/001787.html

And since then I've found two other drivers  affected (uartlite and
i2c-pxa).

Could we at least make platform_device.id an int so as to clear up the
confusion? I doubt that the id will ever be a large number anyway.

To go one step further, I am questioning the real value of this naming
exception for these "unique" platform devices. On top of the bugs I
mentioned above, it has potential for compatibility breakage: adding a
second device of the same type will rename the first one from "foo" to
"foo.0". It also requires specific checks in many individual platform
drivers. All this, as I understand it, for a purely aesthetic reason. I
don't think this is worth it. Would there be any objection to simply
getting rid of this exception and having all platform devices named
"foo.%d"?

-- 
Jean Delvare
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Platform device id, Jean Delvare, (Fri Sep 7, 9:35 am)
Re: Platform device id, Greg KH, (Sat Sep 8, 9:30 am)
[PATCH] Make platform_device.id an int, Jean Delvare, (Sun Sep 9, 6:54 am)
Re: Platform device id, Dmitry Torokhov, (Fri Sep 7, 10:58 am)
Re: Platform device id, Henrique de Moraes Holschuh..., (Fri Sep 7, 4:56 pm)
Re: Platform device id, Jean Delvare, (Sat Sep 8, 4:40 am)
Re: Platform device id, Henrique de Moraes Holschuh..., (Mon Sep 10, 6:45 pm)
Re: Platform device id, David Brownell, (Fri Sep 7, 12:41 pm)
Re: Platform device id, Henrique de Moraes Holschuh..., (Fri Sep 7, 5:00 pm)
Re: Platform device id, David Brownell, (Fri Sep 7, 5:41 pm)
Re: Platform device id, Henrique de Moraes Holschuh..., (Fri Sep 7, 6:04 pm)
Re: Platform device id, David Brownell, (Fri Sep 7, 8:18 pm)
Re: Platform device id, Henrique de Moraes Holschuh..., (Fri Sep 7, 11:50 pm)
Re: Platform device id, Jean Delvare, (Sat Sep 8, 4:55 am)
Re: Platform device id, Henrique de Moraes Holschuh..., (Mon Sep 10, 6:52 pm)
Re: Platform device id, Jean Delvare, (Tue Sep 11, 3:43 am)
Re: Platform device id, Henrique de Moraes Holschuh..., (Tue Sep 11, 9:44 am)
Re: Platform device id, Jean Delvare, (Tue Sep 11, 10:05 am)
Re: Platform device id, Jean Delvare, (Fri Sep 7, 12:36 pm)