summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-09-13 02:06:57 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-10-13 01:51:02 +0400
commit19c38de88a80913351fcacefdb461cc0b585fa87 (patch)
tree17d2978ce27861926a0d9a3eb49471b9b736f968 /drivers/md
parent5901d0145c6b9e791bacd049eea11c9db9a3006e (diff)
downloadlinux-19c38de88a80913351fcacefdb461cc0b585fa87.tar.xz
kobjects: fix up improper use of the kobject name field
A number of different drivers incorrect access the kobject name field directly. This is not correct as the name might not be in the array. Use the proper accessor function instead.
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index e8f102ea9b03..acf1b81b47cb 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -3076,8 +3076,7 @@ static struct kobject *md_probe(dev_t dev, int *part, void *data)
mddev->gendisk = disk;
mutex_unlock(&disks_mutex);
mddev->kobj.parent = &disk->kobj;
- mddev->kobj.k_name = NULL;
- snprintf(mddev->kobj.name, KOBJ_NAME_LEN, "%s", "md");
+ kobject_set_name(&mddev->kobj, "%s", "md");
mddev->kobj.ktype = &md_ktype;
if (kobject_register(&mddev->kobj))
printk(KERN_WARNING "md: cannot register %s/md - name in use\n",