Re: [PATCH] Driver Core patches for 2.6.7

From: Greg KH
Date: Tue Jun 22 2004 - 15:12:34 EST


ChangeSet 1.1722.111.20, 2004/06/10 09:25:58-07:00, dtor_core@xxxxxxxxxxxxx

[PATCH] Driver Core: Suppress platform device suffixes

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@xxxxxxx>
Signed-off-by: Greg Kroah-Hartman <greg@xxxxxxxxx>


drivers/base/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 Tue Jun 22 09:47:19 2004
+++ b/drivers/base/platform.c Tue Jun 22 09:47:19 2004
@@ -117,7 +117,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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/