]> git.openfabrics.org - compat-rdma/compat.git/commitdiff
Make kobject_set_name_vargs() do nothing on <= 2.6.24
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Wed, 6 Jan 2010 02:00:04 +0000 (18:00 -0800)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Mon, 11 Jan 2010 17:57:46 +0000 (09:57 -0800)
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 <lrodriguez@atheros.com>
compat/compat-2.6.26.c

index 960a79a191db55f4aeec61d2fed38dba7f0b7606..d591eb0a18c06b424b38788693155456b37d000f 100644 (file)
@@ -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