diff options
| author | Jonathan Corbet <corbet@lwn.net> | 2004-03-11 23:20:49 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <greg@kroah.com> | 2004-03-11 23:20:49 -0800 |
| commit | fa31a26022c2e755c7673b56d5c19801525c6c1e (patch) | |
| tree | cf5bcc7e2c2f44d1f8c0b0cc2809db03b4b390f4 /include/linux | |
| parent | e9e883fee893e60c22da2eafd9e4c92338506405 (diff) | |
[PATCH] cdev 2/2: hide cdev->kobj
The existing cdev interface requires users to deal with the embedded
kobject in two places:
- The kobject name field must be set before adding the cdev, and
- Should cdev_add() fail, a call to kobject_put() is required.
IMO, this exposure of the embedded kobject makes the interface more brittle
and harder to understand. It's also unnecessary. With the removal of
/sys/cdev, a call to cdev_del() will nicely replace kobject_put(), and the
name setting is easily wrapped.
This is against 2.6.4, but depends on the /sys/cdev removal patch.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/cdev.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/cdev.h b/include/linux/cdev.h index f1996ec09e96..b8618f984165 100644 --- a/include/linux/cdev.h +++ b/include/linux/cdev.h @@ -25,5 +25,7 @@ void cdev_del(struct cdev *); void cd_forget(struct inode *); +#define cdev_set_name(cdev, args...) kobject_set_name(&((cdev)->kobj), ##args) + #endif #endif |
