diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-02-04 07:42:46 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-02-04 07:42:46 -0800 |
| commit | a6cc48eeea438b9d9e05943beebc31c52e76d32f (patch) | |
| tree | 425f824849d5e8b0c7ffc36f9d70c1b21ba10695 /drivers/base/driver.c | |
| parent | 7cf7669143db087e5cb36d1e07143938ff467147 (diff) | |
| parent | 0c98b19fe571ede1f14bd95b855bcbe2cca99bcf (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6:
Driver core: Remove unneeded get_{device,driver}() calls.
Driver core: Update some prototypes in platform.txt
driver core: convert to use class_find_device api
PM: Export device_pm_schedule_removal
nozomi: finish constification
nozomi: constify driver
nozomi driver update
Add ja_JP translation of stable_kernel_rules.txt
kobject: kerneldoc comment fix
kobject: Always build in kernel/ksysfs.o.
Diffstat (limited to 'drivers/base/driver.c')
| -rw-r--r-- | drivers/base/driver.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/base/driver.c b/drivers/base/driver.c index a35f04121a00..ba75184c653c 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -97,10 +97,9 @@ int driver_create_file(struct device_driver *drv, struct driver_attribute *attr) { int error; - if (get_driver(drv)) { + if (drv) error = sysfs_create_file(&drv->p->kobj, &attr->attr); - put_driver(drv); - } else + else error = -EINVAL; return error; } @@ -114,10 +113,8 @@ EXPORT_SYMBOL_GPL(driver_create_file); void driver_remove_file(struct device_driver *drv, struct driver_attribute *attr) { - if (get_driver(drv)) { + if (drv) sysfs_remove_file(&drv->p->kobj, &attr->attr); - put_driver(drv); - } } EXPORT_SYMBOL_GPL(driver_remove_file); |
