aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/driver.c')
-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 e3b58407fedc..633ae1d70e14 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
124 124
125 125
126/** 126/**
127 * driver_add_kobj - add a kobject below the specified driver
128 *
129 * You really don't want to do this, this is only here due to one looney
130 * iseries driver, go poke those developers if you are annoyed about
131 * this...
132 */
133int driver_add_kobj(struct device_driver *drv, struct kobject *kobj,
134 const char *fmt, ...)
135{
136 va_list args;
137 char *name;
138
139 va_start(args, fmt);
140 name = kvasprintf(GFP_KERNEL, fmt, args);
141 va_end(args);
142
143 if (!name)
144 return -ENOMEM;
145
146 return kobject_add_ng(kobj, &drv->kobj, "%s", name);
147}
148EXPORT_SYMBOL_GPL(driver_add_kobj);
149
150/**
127 * get_driver - increment driver reference count. 151 * get_driver - increment driver reference count.
128 * @drv: driver. 152 * @drv: driver.
129 */ 153 */