public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Platform device id
@ 2007-09-07 13:35 Jean Delvare
  2007-09-07 14:58 ` Dmitry Torokhov
  2007-09-08 13:30 ` Greg KH
  0 siblings, 2 replies; 19+ messages in thread
From: Jean Delvare @ 2007-09-07 13:35 UTC (permalink / raw)
  To: Greg KH; +Cc: LKML, David Brownell

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

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2007-09-11 14:05 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-07 13:35 Platform device id Jean Delvare
2007-09-07 14:58 ` Dmitry Torokhov
2007-09-07 16:36   ` Jean Delvare
2007-09-07 16:41   ` David Brownell
2007-09-07 21:00     ` Henrique de Moraes Holschuh
2007-09-07 21:41       ` David Brownell
2007-09-07 22:04         ` Henrique de Moraes Holschuh
2007-09-08  0:18           ` David Brownell
2007-09-08  3:50             ` Henrique de Moraes Holschuh
2007-09-08  8:55               ` Jean Delvare
2007-09-10 22:52                 ` Henrique de Moraes Holschuh
2007-09-11  7:43                   ` Jean Delvare
2007-09-11 13:44                     ` Henrique de Moraes Holschuh
2007-09-11 14:05                       ` Jean Delvare
2007-09-07 20:56   ` Henrique de Moraes Holschuh
2007-09-08  8:40     ` Jean Delvare
2007-09-10 22:45       ` Henrique de Moraes Holschuh
2007-09-08 13:30 ` Greg KH
2007-09-09 10:54   ` [PATCH] Make platform_device.id an int Jean Delvare

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox