summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-12-19 15:54:39 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 20:40:34 -0800
commitcbe9c595f1de2e2a98403be2c14bfbc2486e84c4 (patch)
treec3e3a30bb18e1597dda4bc28c11c3add049e1e02 /drivers/base
parent23b9c1ab5baf368a32b7242bf110ef1f48700d04 (diff)
downloadlinux-3.10-cbe9c595f1de2e2a98403be2c14bfbc2486e84c4.tar.gz
linux-3.10-cbe9c595f1de2e2a98403be2c14bfbc2486e84c4.tar.bz2
linux-3.10-cbe9c595f1de2e2a98403be2c14bfbc2486e84c4.zip
Driver: add driver_add_kobj for looney iseries_veth driver
The iseries driver wants to hang kobjects off of its driver, so, to preserve backwards compatibility, we need to add a call to the driver core to allow future changes to work properly. Hopefully no one uses this function in the future and the iseries_veth driver authors come to their senses so I can remove this hack... Cc: Dave Larson <larson1@us.ibm.com> Cc: Santiago Leon <santil@us.ibm.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/driver.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index e3b58407fed..633ae1d70e1 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -124,6 +124,30 @@ void driver_remove_file(struct device_driver * drv, struct driver_attribute * at
/**
+ * driver_add_kobj - add a kobject below the specified driver
+ *
+ * You really don't want to do this, this is only here due to one looney
+ * iseries driver, go poke those developers if you are annoyed about
+ * this...
+ */
+int driver_add_kobj(struct device_driver *drv, struct kobject *kobj,
+ const char *fmt, ...)
+{
+ va_list args;
+ char *name;
+
+ va_start(args, fmt);
+ name = kvasprintf(GFP_KERNEL, fmt, args);
+ va_end(args);
+
+ if (!name)
+ return -ENOMEM;
+
+ return kobject_add_ng(kobj, &drv->kobj, "%s", name);
+}
+EXPORT_SYMBOL_GPL(driver_add_kobj);
+
+/**
* get_driver - increment driver reference count.
* @drv: driver.
*/