public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* chris: struct device - replace bus_id with dev_name(), dev_set_name()
@ 2008-11-07  0:38 Kay Sievers
  2008-11-07 12:01 ` Jesper Nilsson
  0 siblings, 1 reply; 4+ messages in thread
From: Kay Sievers @ 2008-11-07  0:38 UTC (permalink / raw)
  To: Jesper Nilsson; +Cc: Greg KH, linux-kernel

(I did not compile or test it, please let me know, or help fixing
 it, if something is wrong with the conversion)

This patch is part of a larger patch series which will remove
the "char bus_id[20]" name string from struct device. The device
name is managed in the kobject anyway, and without any size
limitation, and just needlessly copied into "struct device".

To set and read the device name dev_name(dev) and dev_set_name(dev)
must be used. If your code uses static kobjects, which it shouldn't
do, "const char *init_name" can be used to statically provide the
name the registered device should have. At registration time, the
init_name field is cleared, to enforce the use of dev_name(dev) to
access the device name at a later time.

We need to get rid of all occurrences of bus_id in the entire tree
to be able to enable the new interface. Please apply this patch,
and possibly convert any remaining remaining occurrences of bus_id.

We want to submit a patch to -next, which will remove bus_id from
"struct device", to find the remaining pieces to convert, and finally
switch over to the new api, which will remove the 20 bytes array
and does no longer have a size limitation.

Thanks,
Kay


From: Kay Sievers <kay.sievers@vrfy.org>
Subject: chris: struct device - replace bus_id with dev_name(), dev_set_name()

Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
---
 arch/cris/arch-v32/drivers/iop_fw_load.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/arch/cris/arch-v32/drivers/iop_fw_load.c
+++ b/arch/cris/arch-v32/drivers/iop_fw_load.c
@@ -24,12 +24,12 @@
 #error "Please contact <greg@kroah.com> for details on how to fix it properly."
 
 static struct device iop_spu_device[2] = {
-	{ .bus_id =     "iop-spu0", },
-	{ .bus_id =     "iop-spu1", },
+	{ .init_name =     "iop-spu0", },
+	{ .init_name =     "iop-spu1", },
 };
 
 static struct device iop_mpu_device = {
-	.bus_id =       "iop-mpu",
+	.init_name =       "iop-mpu",
 };
 
 static int wait_mpu_idle(void)



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

end of thread, other threads:[~2008-11-18  8:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-07  0:38 chris: struct device - replace bus_id with dev_name(), dev_set_name() Kay Sievers
2008-11-07 12:01 ` Jesper Nilsson
2008-11-17 22:53   ` Greg KH
2008-11-18  8:14     ` Jesper Nilsson

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