Re: [RFC] 2.6.0 EDD enhancements
From: Matt Domsch
Date: Fri Dec 19 2003 - 15:38:58 EST
> 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.
Ok, I'll gladly make that change, but I still need a handle on the
sdev_gendev.kobj in order to make the symlink:
> rc = sysfs_create_link(&edev->kobj,
> &sdev->sdev_gendev.kobj,
> "disc");
While there's an accessor function to_scsi_device() to go from the
struct device to the struct scsi_device, there's not accessor to go from the
scsi_device to the struct device, which would further abstract
struct internals. Can I get such added to a SCSI header file?
Something like:
static inline struct device *
sdev_to_gendev(struct scsi_device *sdev)
{
return &sdev->sdev_gendev;
}
Thanks,
Matt
--
Matt Domsch
Sr. Software Engineer, Lead Engineer
Dell Linux Solutions www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/