Al,
A BUG_ON at device.h:215 is triggered by
scsi_unregister_host -> sd_detach -> driverfs_remove_partitions ->
device_remove _file
because driverfs_remove_partitions is called for a device
where driverfs_create_partitions was not called for.
(A device without media - no partitions have ever been seen.)
There are various ways to fix - I'll leave it to you to pick
some appropriate one.
Andries
[I find that code becomes ugly when one includes a struct in
another struct. Lots of assignments
ptr = &(p->start_of_struct);
The advantage of having things separate is that one can use
NULL to mean "uninitialized", while &(p->start_of_struct)
is never NULL. So, I wouldn't mind adding a * and an r in the
struct device hd_driverfs_dev; /* support driverfs hiearchy */
in struct hd_struct. But you may have other preferences.]