diff options
Diffstat (limited to 'drivers/base/core.c')
-rw-r--r-- | drivers/base/core.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c index 72eccae4904b..ee0a51a3a41d 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -760,6 +760,22 @@ 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 | * @fmt: format string for the device's name | ||
766 | */ | ||
767 | int dev_set_name(struct device *dev, const char *fmt, ...) | ||
768 | { | ||
769 | va_list vargs; | ||
770 | |||
771 | va_start(vargs, fmt); | ||
772 | vsnprintf(dev->bus_id, sizeof(dev->bus_id), fmt, vargs); | ||
773 | va_end(vargs); | ||
774 | return 0; | ||
775 | } | ||
776 | EXPORT_SYMBOL_GPL(dev_set_name); | ||
777 | |||
778 | /** | ||
763 | * device_add - add device to device hierarchy. | 779 | * device_add - add device to device hierarchy. |
764 | * @dev: device. | 780 | * @dev: device. |
765 | * | 781 | * |