aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_transport_spi.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@steeleye.com>2005-08-14 18:09:01 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-08-14 18:21:27 -0400
commitd0a7e574007fd547d72ec693bfa35778623d0738 (patch)
tree3457bdf4e8eaf870971aab03c99c31534ba85658 /drivers/scsi/scsi_transport_spi.c
parent10c1b88987d618f4f89c10e11e574c76de73b5e7 (diff)
[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>
Diffstat (limited to 'drivers/scsi/scsi_transport_spi.c')
-rw-r--r--drivers/scsi/scsi_transport_spi.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index 02134fce2174..89f6b7feb9c2 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -162,7 +162,8 @@ static inline enum spi_signal_type spi_signal_to_value(const char *name)
162 return SPI_SIGNAL_UNKNOWN; 162 return SPI_SIGNAL_UNKNOWN;
163} 163}
164 164
165static int spi_host_setup(struct device *dev) 165static int spi_host_setup(struct transport_container *tc, struct device *dev,
166 struct class_device *cdev)
166{ 167{
167 struct Scsi_Host *shost = dev_to_shost(dev); 168 struct Scsi_Host *shost = dev_to_shost(dev);
168 169
@@ -196,7 +197,9 @@ static int spi_host_match(struct attribute_container *cont,
196 return &i->t.host_attrs.ac == cont; 197 return &i->t.host_attrs.ac == cont;
197} 198}
198 199
199static int spi_device_configure(struct device *dev) 200static int spi_device_configure(struct transport_container *tc,
201 struct device *dev,
202 struct class_device *cdev)
200{ 203{
201 struct scsi_device *sdev = to_scsi_device(dev); 204 struct scsi_device *sdev = to_scsi_device(dev);
202 struct scsi_target *starget = sdev->sdev_target; 205 struct scsi_target *starget = sdev->sdev_target;
@@ -214,7 +217,9 @@ static int spi_device_configure(struct device *dev)
214 return 0; 217 return 0;
215} 218}
216 219
217static int spi_setup_transport_attrs(struct device *dev) 220static int spi_setup_transport_attrs(struct transport_container *tc,
221 struct device *dev,
222 struct class_device *cdev)
218{ 223{
219 struct scsi_target *starget = to_scsi_target(dev); 224 struct scsi_target *starget = to_scsi_target(dev);
220 225