From: Senthil Balasubramanian Date: Tue, 12 Jan 2010 10:51:02 +0000 (+0530) Subject: Fix dev_set_name() for kernel 2.6.23 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=60cd75a310b0e9815b942581ba515a5cacf5596f;p=openwrt%2Fstaging%2Fblogic.git Fix dev_set_name() for kernel 2.6.23 Signed-off-by: Senthil Balasubramanian --- diff --git a/compat/compat-2.6.26.c b/compat/compat-2.6.26.c index d591eb0a18c0..668d658e0084 100644 --- a/compat/compat-2.6.26.c +++ b/compat/compat-2.6.26.c @@ -55,6 +55,19 @@ static int kobject_set_name_vargs(struct kobject *kobj, const char *fmt, va_list vargs) { + struct device *dev; + unsigned int len; + va_list aq; + + dev = container_of(kobj, struct device, kobj); + + va_copy(aq, vargs); + len = vsnprintf(NULL, 0, fmt, aq); + va_end(aq); + + len = len < BUS_ID_SIZE ? (len + 1) : BUS_ID_SIZE; + + vsnprintf(dev->bus_id, len, fmt, vargs); return 0; } #endif