Messages in this thread |  | | | Subject | Re: [RFC] 2.6.0 EDD enhancements | | From | James Bottomley <> | | Date | 19 Dec 2003 15:23:21 -0500 |
| |
On Fri, 2003-12-19 at 14:01, Matt Domsch wrote: > @@ -639,11 +629,11 @@ > pci_dev = edd_get_pci_dev(edev); > if (pci_dev) { > struct scsi_device * sdev = edd_find_matching_scsi_device(edev); > - if (sdev && get_device(&sdev->sdev_driverfs_dev)) { > + if (sdev && get_device(&sdev->sdev_gendev)) { > rc = sysfs_create_link(&edev->kobj, > - &sdev->sdev_driverfs_dev.kobj, > + &sdev->sdev_gendev.kobj, > "disc"); > - put_device(&sdev->sdev_driverfs_dev); > + put_device(&sdev->sdev_gendev);
This is a bit nasty...you're assuming a lot of hidden knowledge about the layout of sysfs objects in scsi_device in this code.
The current(*) way you should be doing this is to use scsi_device_get() in your edd_match_scsi_dev() and do a scsi_device_put() after creating the link...that should be hotplug robust.
(*) since SCSI hotplug is a work in progress, this may change...
James
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|  |