From 2d7c39a08265fb4a45e1686476959b9281092894 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Tue, 5 Jan 2010 18:00:04 -0800 Subject: [PATCH] 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 --- compat/compat-2.6.26.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 -- 2.30.2