diff options
author | Brian Behlendorf <[email protected]> | 2009-10-02 16:21:59 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2009-10-02 16:21:59 -0700 |
commit | 39ab544079015f2b7ad854ef9c8815290d971f17 (patch) | |
tree | 3528bb8f0d6602bc4c39d265d2600fc44978c6cf /module/splat | |
parent | 51a727e90f1dd11194737e64e85ca09d34be5d8b (diff) |
Use kobject_set_name() for increased portability.
As of 2.6.25 kobj->k_name was replaced with kobj->name. Some distros
such as RHEL5 (2.6.18) add a patch to prevent this from being a problem
but other older distros such as SLES10 (2.6.16) have not. To avoid
the whole issue I'm updating the code to use kobject_set_name() which
does what I want and has existed all the way back to 2.6.11.
Diffstat (limited to 'module/splat')
-rw-r--r-- | module/splat/splat-ctl.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/module/splat/splat-ctl.c b/module/splat/splat-ctl.c index 9e52ab4fb..36a690743 100644 --- a/module/splat/splat-ctl.c +++ b/module/splat/splat-ctl.c @@ -590,6 +590,7 @@ static loff_t splat_seek(struct file *file, loff_t offset, int origin) return rc; } +static struct cdev splat_cdev; static struct file_operations splat_fops = { .owner = THIS_MODULE, .open = splat_open, @@ -603,11 +604,6 @@ static struct file_operations splat_fops = { .llseek = splat_seek, }; -static struct cdev splat_cdev = { - .owner = THIS_MODULE, - .kobj = { .name = SPLAT_NAME, }, -}; - static int splat_init(void) { @@ -638,6 +634,8 @@ splat_init(void) /* Support for registering a character driver */ cdev_init(&splat_cdev, &splat_fops); + splat_cdev.owner = THIS_MODULE; + kobject_set_name(&splat_cdev.kobj, SPLAT_NAME); if ((rc = cdev_add(&splat_cdev, dev, SPLAT_MINORS))) { printk(KERN_ERR "SPLAT: Error adding cdev, %d\n", rc); kobject_put(&splat_cdev.kobj); |