diff options
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/pktcdvd.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 17da6999bef0..d1ee38361e0b 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -110,17 +110,18 @@ static struct pktcdvd_kobj* pkt_kobj_create(struct pktcdvd_device *pd, | |||
110 | struct kobj_type* ktype) | 110 | struct kobj_type* ktype) |
111 | { | 111 | { |
112 | struct pktcdvd_kobj *p; | 112 | struct pktcdvd_kobj *p; |
113 | int error; | ||
114 | |||
113 | p = kzalloc(sizeof(*p), GFP_KERNEL); | 115 | p = kzalloc(sizeof(*p), GFP_KERNEL); |
114 | if (!p) | 116 | if (!p) |
115 | return NULL; | 117 | return NULL; |
116 | kobject_set_name(&p->kobj, "%s", name); | ||
117 | p->kobj.parent = parent; | ||
118 | p->kobj.ktype = ktype; | ||
119 | p->pd = pd; | 118 | p->pd = pd; |
120 | if (kobject_register(&p->kobj) != 0) { | 119 | error = kobject_init_and_add(&p->kobj, ktype, parent, "%s", name); |
120 | if (error) { | ||
121 | kobject_put(&p->kobj); | 121 | kobject_put(&p->kobj); |
122 | return NULL; | 122 | return NULL; |
123 | } | 123 | } |
124 | kobject_uevent(&p->kobj, KOBJ_ADD); | ||
124 | return p; | 125 | return p; |
125 | } | 126 | } |
126 | /* | 127 | /* |