From: Luis R. Rodriguez Date: Wed, 6 Jan 2010 02:00:04 +0000 (-0800) Subject: Make kobject_set_name_vargs() do nothing on <= 2.6.24 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=2d7c39a08265fb4a45e1686476959b9281092894;p=openwrt%2Fstaging%2Fblogic.git Make kobject_set_name_vargs() do nothing on <= 2.6.24 The struct kobject does not have a name member on older kernels so naming something naming a kobject will be futile. This implies dev_set_name() won't be able to rename the kobject. This may actually bust 2.6.24, I believe we discussed this particular issue on the linux-wireless mailing list at some point with a person trying 2.6.24. If there is an issue with this patch we can go back and check the list. I'm offline rigtt now though so trying to get compilation to work at least. Signed-off-by: Luis R. Rodriguez --- diff --git a/compat/compat-2.6.26.c b/compat/compat-2.6.26.c index 960a79a191db..d591eb0a18c0 100644 --- a/compat/compat-2.6.26.c +++ b/compat/compat-2.6.26.c @@ -20,6 +20,9 @@ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)) +/* 2.6.24 does not have the struct kobject with a name */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)) + /** * kobject_set_name_vargs - Set the name of an kobject * @kobj: struct kobject to set the name of @@ -47,6 +50,14 @@ int kobject_set_name_vargs(struct kobject *kobj, const char *fmt, kfree(old_name); return 0; } +#else +static +int kobject_set_name_vargs(struct kobject *kobj, const char *fmt, + va_list vargs) +{ + return 0; +} +#endif /** * dev_set_name - set a device name