summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-05-30 08:29:39 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-30 08:29:39 +0400
commit916941b2bfd9c4a8b66855f198ae16c3f51ef570 (patch)
tree471867d3d460f10d1620efe3c85763c4d95fa14d /drivers
parentfbf4d7ffda0398e8b20aa8b34ca751bf946699ef (diff)
parent413c239fad68258157f903b3ffd9bfcc53f5e34b (diff)
downloadlinux-916941b2bfd9c4a8b66855f198ae16c3f51ef570.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6: driver-core: prepare for 2.6.27 api change by adding dev_set_name
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/core.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 72eccae4904b..422cfcad486d 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -760,6 +760,21 @@ static void device_remove_class_symlinks(struct device *dev)
}
/**
+ * dev_set_name - set a device name
+ * @dev: device
+ */
+int dev_set_name(struct device *dev, const char *fmt, ...)
+{
+ va_list vargs;
+
+ va_start(vargs, fmt);
+ vsnprintf(dev->bus_id, sizeof(dev->bus_id), fmt, vargs);
+ va_end(vargs);
+ return 0;
+}
+EXPORT_SYMBOL_GPL(dev_set_name);
+
+/**
* device_add - add device to device hierarchy.
* @dev: device.
*