aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2008-05-29 20:16:40 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-05-30 00:10:01 -0400
commit413c239fad68258157f903b3ffd9bfcc53f5e34b (patch)
tree7508df475d5f1ab505e27e98573953c1e394f0c6 /drivers
parent0a2ce2ffc358da96792d514c1024b72c52be9cc1 (diff)
driver-core: prepare for 2.6.27 api change by adding dev_set_name
Create the dev_set_name function now so that various subsystems can start changing over to it before other changes in 2.6.27 will make it compulsory. Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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)
760} 760}
761 761
762/** 762/**
763 * dev_set_name - set a device name
764 * @dev: device
765 */
766int dev_set_name(struct device *dev, const char *fmt, ...)
767{
768 va_list vargs;
769
770 va_start(vargs, fmt);
771 vsnprintf(dev->bus_id, sizeof(dev->bus_id), fmt, vargs);
772 va_end(vargs);
773 return 0;
774}
775EXPORT_SYMBOL_GPL(dev_set_name);
776
777/**
763 * device_add - add device to device hierarchy. 778 * device_add - add device to device hierarchy.
764 * @dev: device. 779 * @dev: device.
765 * 780 *