lkml.org 
[lkml]   [2004]   [Jun]   [10]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
FromDmitry Torokhov <>
Subject[PATCH 1/3] Suppress platform device suffixes - take 2
DateThu, 10 Jun 2004 01:42:13 -0500
===================================================================

ChangeSet@1.1766, 2004-06-09 23:55:59-05:00, dtor_core@ameritech.net
  sysfs: Do not add numeric suffix to platform device name if device
         id is set to -1. This can be used when there can be only one
         instance of a device (like i8042).

  Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


 platform.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

===================================================================


diff -Nru a/drivers/base/platform.c b/drivers/base/platform.c
--- a/drivers/base/platform.c	2004-06-10 01:33:27 -05:00
+++ b/drivers/base/platform.c	2004-06-10 01:33:27 -05:00
@@ -33,7 +33,10 @@
 
 	pdev->dev.bus = &platform_bus_type;
 	
-	snprintf(pdev->dev.bus_id,BUS_ID_SIZE,"%s%u",pdev->name,pdev->id);
+	if (pdev->id != -1)
+		snprintf(pdev->dev.bus_id, BUS_ID_SIZE, "%s%u", pdev->name, pdev->id);
+	else
+		strlcpy(pdev->dev.bus_id, pdev->name, BUS_ID_SIZE);
 
 	pr_debug("Registering platform device '%s'. Parent at %s\n",
 		 pdev->dev.bus_id,pdev->dev.parent->bus_id);
-
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/
\
 
 \ /
  Last update: 2005-03-22 13:03    [from the cache]
©2003-2008