[SCSI] correct transport class abstraction to work outside SCSI
I recently tried to construct a totally generic transport class and found there were certain features missing from the current abstract transport class. Most notable is that you have to hang the data on the class_device but most of the API is framed in terms of the generic device, not the class_device. These changes are two fold - Provide the class_device to all of the setup and configure APIs - Provide and extra API to take the device and the attribute class and return the corresponding class_device Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:

committed by
James Bottomley

parent
10c1b88987
commit
d0a7e57400
@@ -162,7 +162,8 @@ static inline enum spi_signal_type spi_signal_to_value(const char *name)
|
||||
return SPI_SIGNAL_UNKNOWN;
|
||||
}
|
||||
|
||||
static int spi_host_setup(struct device *dev)
|
||||
static int spi_host_setup(struct transport_container *tc, struct device *dev,
|
||||
struct class_device *cdev)
|
||||
{
|
||||
struct Scsi_Host *shost = dev_to_shost(dev);
|
||||
|
||||
@@ -196,7 +197,9 @@ static int spi_host_match(struct attribute_container *cont,
|
||||
return &i->t.host_attrs.ac == cont;
|
||||
}
|
||||
|
||||
static int spi_device_configure(struct device *dev)
|
||||
static int spi_device_configure(struct transport_container *tc,
|
||||
struct device *dev,
|
||||
struct class_device *cdev)
|
||||
{
|
||||
struct scsi_device *sdev = to_scsi_device(dev);
|
||||
struct scsi_target *starget = sdev->sdev_target;
|
||||
@@ -214,7 +217,9 @@ static int spi_device_configure(struct device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int spi_setup_transport_attrs(struct device *dev)
|
||||
static int spi_setup_transport_attrs(struct transport_container *tc,
|
||||
struct device *dev,
|
||||
struct class_device *cdev)
|
||||
{
|
||||
struct scsi_target *starget = to_scsi_target(dev);
|
||||
|
||||
|
Reference in New Issue
Block a user