diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/pktcdvd.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 3535ef89667..17da6999bef 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -301,18 +301,16 @@ static struct kobj_type kobj_pkt_type_wqueue = { | |||
301 | static void pkt_sysfs_dev_new(struct pktcdvd_device *pd) | 301 | static void pkt_sysfs_dev_new(struct pktcdvd_device *pd) |
302 | { | 302 | { |
303 | if (class_pktcdvd) { | 303 | if (class_pktcdvd) { |
304 | pd->clsdev = class_device_create(class_pktcdvd, | 304 | pd->dev = device_create(class_pktcdvd, NULL, pd->pkt_dev, "%s", pd->name); |
305 | NULL, pd->pkt_dev, | 305 | if (IS_ERR(pd->dev)) |
306 | NULL, "%s", pd->name); | 306 | pd->dev = NULL; |
307 | if (IS_ERR(pd->clsdev)) | ||
308 | pd->clsdev = NULL; | ||
309 | } | 307 | } |
310 | if (pd->clsdev) { | 308 | if (pd->dev) { |
311 | pd->kobj_stat = pkt_kobj_create(pd, "stat", | 309 | pd->kobj_stat = pkt_kobj_create(pd, "stat", |
312 | &pd->clsdev->kobj, | 310 | &pd->dev->kobj, |
313 | &kobj_pkt_type_stat); | 311 | &kobj_pkt_type_stat); |
314 | pd->kobj_wqueue = pkt_kobj_create(pd, "write_queue", | 312 | pd->kobj_wqueue = pkt_kobj_create(pd, "write_queue", |
315 | &pd->clsdev->kobj, | 313 | &pd->dev->kobj, |
316 | &kobj_pkt_type_wqueue); | 314 | &kobj_pkt_type_wqueue); |
317 | } | 315 | } |
318 | } | 316 | } |
@@ -322,7 +320,7 @@ static void pkt_sysfs_dev_remove(struct pktcdvd_device *pd) | |||
322 | pkt_kobj_remove(pd->kobj_stat); | 320 | pkt_kobj_remove(pd->kobj_stat); |
323 | pkt_kobj_remove(pd->kobj_wqueue); | 321 | pkt_kobj_remove(pd->kobj_wqueue); |
324 | if (class_pktcdvd) | 322 | if (class_pktcdvd) |
325 | class_device_destroy(class_pktcdvd, pd->pkt_dev); | 323 | device_destroy(class_pktcdvd, pd->pkt_dev); |
326 | } | 324 | } |
327 | 325 | ||
328 | 326 | ||