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>

authored by Stephen Rothwell and committed by Greg Kroah-Hartman 413c239f 0a2ce2ff

+18
+15
drivers/base/core.c
··· 760 760 } 761 761 762 762 /** 763 + * dev_set_name - set a device name 764 + * @dev: device 765 + */ 766 + int 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 + } 775 + EXPORT_SYMBOL_GPL(dev_set_name); 776 + 777 + /** 763 778 * device_add - add device to device hierarchy. 764 779 * @dev: device. 765 780 *
+3
include/linux/device.h
··· 385 385 return dev->bus_id; 386 386 } 387 387 388 + extern int dev_set_name(struct device *dev, const char *name, ...) 389 + __attribute__((format(printf, 2, 3))); 390 + 388 391 #ifdef CONFIG_NUMA 389 392 static inline int dev_to_node(struct device *dev) 390 393 {