diff options
-rw-r--r-- | drivers/block/pktcdvd.c | 16 | ||||
-rw-r--r-- | include/linux/pktcdvd.h | 2 |
2 files changed, 8 insertions, 10 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 | ||
diff --git a/include/linux/pktcdvd.h b/include/linux/pktcdvd.h index 5ea4f05683f..04b4d7330e6 100644 --- a/include/linux/pktcdvd.h +++ b/include/linux/pktcdvd.h | |||
@@ -290,7 +290,7 @@ struct pktcdvd_device | |||
290 | int write_congestion_off; | 290 | int write_congestion_off; |
291 | int write_congestion_on; | 291 | int write_congestion_on; |
292 | 292 | ||
293 | struct class_device *clsdev; /* sysfs pktcdvd[0-7] class dev */ | 293 | struct device *dev; /* sysfs pktcdvd[0-7] dev */ |
294 | struct pktcdvd_kobj *kobj_stat; /* sysfs pktcdvd[0-7]/stat/ */ | 294 | struct pktcdvd_kobj *kobj_stat; /* sysfs pktcdvd[0-7]/stat/ */ |
295 | struct pktcdvd_kobj *kobj_wqueue; /* sysfs pktcdvd[0-7]/write_queue/ */ | 295 | struct pktcdvd_kobj *kobj_wqueue; /* sysfs pktcdvd[0-7]/write_queue/ */ |
296 | 296 | ||