Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75837
b: refs/heads/master
c: cbe9c59
h: refs/heads/master
i:
  75835: 6cfacd8
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Jan 25, 2008
1 parent db5c6b3 commit 74b5bba
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 23b9c1ab5baf368a32b7242bf110ef1f48700d04
refs/heads/master: cbe9c595f1de2e2a98403be2c14bfbc2486e84c4
24 changes: 24 additions & 0 deletions trunk/drivers/base/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,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.
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/iseries_veth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1705,7 +1705,7 @@ static int __init veth_module_init(void)

kobj = &veth_cnx[i]->kobject;
/* If the add failes, complain but otherwise continue */
if (0 != kobject_add_ng(kobj, &veth_driver.driver.kobj,
if (0 != driver_add_kobj(&veth_driver.driver, kobj,
"cnx%.2d", veth_cnx[i]->remote_lp))
veth_error("cnx %d: Failed adding to sysfs.\n", i);
}
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ extern int __must_check driver_create_file(struct device_driver *,
struct driver_attribute *);
extern void driver_remove_file(struct device_driver *, struct driver_attribute *);

extern int __must_check driver_add_kobj(struct device_driver *drv,
struct kobject *kobj,
const char *fmt, ...);

extern int __must_check driver_for_each_device(struct device_driver * drv,
struct device *start, void *data,
int (*fn)(struct device *, void *));
Expand Down

0 comments on commit 74b5bba

Please sign in to comment.