Skip to content

Commit

Permalink
pktcdvd: removing device does not remove its sysfs dir
Browse files Browse the repository at this point in the history
This is the counterpart to cba7671
("pktcdvd: remove broken dev_t export of class devices").  Device is not
registered using dev_t, so it should not be destroyed using device_destroy
which looks up the device by dev_t.  This will fail and adding the device
again will fail with the "duplicate name" error.  This is fixed using
device_unregister instead of device_destroy.

Signed-off-by: Thadeu Lima de Souza Cascardo <[email protected]>
Cc: Kay Sievers <[email protected]>
Cc: Peter Osterlund <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Thadeu Lima de Souza Cascardo authored and torvalds committed Feb 3, 2010
1 parent ea08541 commit ca0bf64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/block/pktcdvd.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ static void pkt_sysfs_dev_remove(struct pktcdvd_device *pd)
pkt_kobj_remove(pd->kobj_stat);
pkt_kobj_remove(pd->kobj_wqueue);
if (class_pktcdvd)
device_destroy(class_pktcdvd, pd->pkt_dev);
device_unregister(pd->dev);
}


Expand Down

0 comments on commit ca0bf64

Please sign in to comment.