Skip to contentSkip to conversation

pktcdvd: removing device does not remove its sysfs dir

PATCH New Thadeu Lima de Souza Cascardo 1 participant 1 message Feb 1, 2010 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pktcdvd: removing device does not remove its sysfs dir

This is the counterpart to cba767175becadc5c4016cceb7bfdd2c7fe722f4. 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.

---
 drivers/block/pktcdvd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/block/pktcdvd.c +1 -1
index 2ddf03a..68b5957 100644
@@ -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);
 }
 
 
Signature · 1 line
1.6.6.1