diff options
author | Maciej Patelczyk <maciej.patelczyk@intel.com> | 2011-04-28 18:06:21 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 07:00:38 -0400 |
commit | 5d937e966d383c4012c19b0e47dc196ba505eb19 (patch) | |
tree | 54639bdc00f70d2e0af9f424e2b4a87a4cd99725 /drivers | |
parent | 115bd1f9e8ee11744818e6eb5351d05ab6a8402e (diff) |
isci: Removed sci_base_object from scic_sds_remote_device.
The 'struct sci_base_object' was removed from the struct
scic_sds_remote_device.
Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com>
[cleaned up sci_dev_to_idev]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/isci/remote_device.c | 47 | ||||
-rw-r--r-- | drivers/scsi/isci/remote_device.h | 15 | ||||
-rw-r--r-- | drivers/scsi/isci/sci_environment.h | 7 | ||||
-rw-r--r-- | drivers/scsi/isci/smp_remote_device.c | 13 | ||||
-rw-r--r-- | drivers/scsi/isci/stp_remote_device.c | 19 |
5 files changed, 42 insertions, 59 deletions
diff --git a/drivers/scsi/isci/remote_device.c b/drivers/scsi/isci/remote_device.c index bb696cf11f2c..3fc66b2a5992 100644 --- a/drivers/scsi/isci/remote_device.c +++ b/drivers/scsi/isci/remote_device.c | |||
@@ -1101,9 +1101,8 @@ static const struct scic_sds_remote_device_state_handler scic_sds_remote_device_ | |||
1101 | 1101 | ||
1102 | static void scic_sds_remote_device_initial_state_enter(void *object) | 1102 | static void scic_sds_remote_device_initial_state_enter(void *object) |
1103 | { | 1103 | { |
1104 | struct scic_sds_remote_device *sci_dev = (struct scic_sds_remote_device *)object; | 1104 | struct scic_sds_remote_device *sci_dev = object; |
1105 | 1105 | ||
1106 | sci_dev = container_of(object, typeof(*sci_dev), parent); | ||
1107 | SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table, | 1106 | SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table, |
1108 | SCI_BASE_REMOTE_DEVICE_STATE_INITIAL); | 1107 | SCI_BASE_REMOTE_DEVICE_STATE_INITIAL); |
1109 | 1108 | ||
@@ -1203,16 +1202,15 @@ static void isci_remote_device_stop_complete(struct isci_host *ihost, | |||
1203 | 1202 | ||
1204 | static void scic_sds_remote_device_stopped_state_enter(void *object) | 1203 | static void scic_sds_remote_device_stopped_state_enter(void *object) |
1205 | { | 1204 | { |
1206 | struct scic_sds_remote_device *sci_dev; | 1205 | struct scic_sds_remote_device *sci_dev = object; |
1207 | struct scic_sds_controller *scic; | 1206 | struct scic_sds_controller *scic; |
1208 | struct isci_remote_device *idev; | 1207 | struct isci_remote_device *idev; |
1209 | struct isci_host *ihost; | 1208 | struct isci_host *ihost; |
1210 | u32 prev_state; | 1209 | u32 prev_state; |
1211 | 1210 | ||
1212 | sci_dev = container_of(object, typeof(*sci_dev), parent); | ||
1213 | scic = scic_sds_remote_device_get_controller(sci_dev); | 1211 | scic = scic_sds_remote_device_get_controller(sci_dev); |
1214 | ihost = scic->ihost; | 1212 | ihost = scic->ihost; |
1215 | idev = sci_object_get_association(sci_dev); | 1213 | idev = sci_dev_to_idev(sci_dev); |
1216 | 1214 | ||
1217 | SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table, | 1215 | SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table, |
1218 | SCI_BASE_REMOTE_DEVICE_STATE_STOPPED); | 1216 | SCI_BASE_REMOTE_DEVICE_STATE_STOPPED); |
@@ -1229,11 +1227,10 @@ static void scic_sds_remote_device_stopped_state_enter(void *object) | |||
1229 | 1227 | ||
1230 | static void scic_sds_remote_device_starting_state_enter(void *object) | 1228 | static void scic_sds_remote_device_starting_state_enter(void *object) |
1231 | { | 1229 | { |
1232 | struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev), | 1230 | struct scic_sds_remote_device *sci_dev = object; |
1233 | parent); | ||
1234 | struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); | 1231 | struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); |
1235 | struct isci_host *ihost = scic->ihost; | 1232 | struct isci_host *ihost = scic->ihost; |
1236 | struct isci_remote_device *idev = sci_object_get_association(sci_dev); | 1233 | struct isci_remote_device *idev = sci_dev_to_idev(sci_dev); |
1237 | 1234 | ||
1238 | SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table, | 1235 | SET_STATE_HANDLER(sci_dev, scic_sds_remote_device_state_handler_table, |
1239 | SCI_BASE_REMOTE_DEVICE_STATE_STARTING); | 1236 | SCI_BASE_REMOTE_DEVICE_STATE_STARTING); |
@@ -1244,11 +1241,10 @@ static void scic_sds_remote_device_starting_state_enter(void *object) | |||
1244 | 1241 | ||
1245 | static void scic_sds_remote_device_ready_state_enter(void *object) | 1242 | static void scic_sds_remote_device_ready_state_enter(void *object) |
1246 | { | 1243 | { |
1247 | struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev), | 1244 | struct scic_sds_remote_device *sci_dev = object; |
1248 | parent); | ||
1249 | struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); | 1245 | struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); |
1250 | struct isci_host *ihost = scic->ihost; | 1246 | struct isci_host *ihost = scic->ihost; |
1251 | struct isci_remote_device *idev = sci_object_get_association(sci_dev); | 1247 | struct isci_remote_device *idev = sci_dev_to_idev(sci_dev); |
1252 | 1248 | ||
1253 | SET_STATE_HANDLER(sci_dev, | 1249 | SET_STATE_HANDLER(sci_dev, |
1254 | scic_sds_remote_device_state_handler_table, | 1250 | scic_sds_remote_device_state_handler_table, |
@@ -1264,14 +1260,13 @@ static void scic_sds_remote_device_ready_state_enter(void *object) | |||
1264 | 1260 | ||
1265 | static void scic_sds_remote_device_ready_state_exit(void *object) | 1261 | static void scic_sds_remote_device_ready_state_exit(void *object) |
1266 | { | 1262 | { |
1267 | struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev), | 1263 | struct scic_sds_remote_device *sci_dev = object; |
1268 | parent); | ||
1269 | if (sci_dev->has_ready_substate_machine) | 1264 | if (sci_dev->has_ready_substate_machine) |
1270 | sci_base_state_machine_stop(&sci_dev->ready_substate_machine); | 1265 | sci_base_state_machine_stop(&sci_dev->ready_substate_machine); |
1271 | else { | 1266 | else { |
1272 | struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); | 1267 | struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); |
1273 | struct isci_host *ihost = scic->ihost; | 1268 | struct isci_host *ihost = scic->ihost; |
1274 | struct isci_remote_device *idev = sci_object_get_association(sci_dev); | 1269 | struct isci_remote_device *idev = sci_dev_to_idev(sci_dev); |
1275 | 1270 | ||
1276 | isci_remote_device_not_ready(ihost, idev, | 1271 | isci_remote_device_not_ready(ihost, idev, |
1277 | SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED); | 1272 | SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED); |
@@ -1280,7 +1275,7 @@ static void scic_sds_remote_device_ready_state_exit(void *object) | |||
1280 | 1275 | ||
1281 | static void scic_sds_remote_device_stopping_state_enter(void *object) | 1276 | static void scic_sds_remote_device_stopping_state_enter(void *object) |
1282 | { | 1277 | { |
1283 | struct scic_sds_remote_device *sci_dev = (struct scic_sds_remote_device *)object; | 1278 | struct scic_sds_remote_device *sci_dev = object; |
1284 | 1279 | ||
1285 | SET_STATE_HANDLER( | 1280 | SET_STATE_HANDLER( |
1286 | sci_dev, | 1281 | sci_dev, |
@@ -1291,7 +1286,7 @@ static void scic_sds_remote_device_stopping_state_enter(void *object) | |||
1291 | 1286 | ||
1292 | static void scic_sds_remote_device_failed_state_enter(void *object) | 1287 | static void scic_sds_remote_device_failed_state_enter(void *object) |
1293 | { | 1288 | { |
1294 | struct scic_sds_remote_device *sci_dev = (struct scic_sds_remote_device *)object; | 1289 | struct scic_sds_remote_device *sci_dev = object; |
1295 | 1290 | ||
1296 | SET_STATE_HANDLER( | 1291 | SET_STATE_HANDLER( |
1297 | sci_dev, | 1292 | sci_dev, |
@@ -1302,7 +1297,7 @@ static void scic_sds_remote_device_failed_state_enter(void *object) | |||
1302 | 1297 | ||
1303 | static void scic_sds_remote_device_resetting_state_enter(void *object) | 1298 | static void scic_sds_remote_device_resetting_state_enter(void *object) |
1304 | { | 1299 | { |
1305 | struct scic_sds_remote_device *sci_dev = (struct scic_sds_remote_device *)object; | 1300 | struct scic_sds_remote_device *sci_dev = object; |
1306 | 1301 | ||
1307 | SET_STATE_HANDLER( | 1302 | SET_STATE_HANDLER( |
1308 | sci_dev, | 1303 | sci_dev, |
@@ -1316,14 +1311,14 @@ static void scic_sds_remote_device_resetting_state_enter(void *object) | |||
1316 | 1311 | ||
1317 | static void scic_sds_remote_device_resetting_state_exit(void *object) | 1312 | static void scic_sds_remote_device_resetting_state_exit(void *object) |
1318 | { | 1313 | { |
1319 | struct scic_sds_remote_device *sci_dev = (struct scic_sds_remote_device *)object; | 1314 | struct scic_sds_remote_device *sci_dev = object; |
1320 | 1315 | ||
1321 | scic_sds_remote_node_context_resume(&sci_dev->rnc, NULL, NULL); | 1316 | scic_sds_remote_node_context_resume(&sci_dev->rnc, NULL, NULL); |
1322 | } | 1317 | } |
1323 | 1318 | ||
1324 | static void scic_sds_remote_device_final_state_enter(void *object) | 1319 | static void scic_sds_remote_device_final_state_enter(void *object) |
1325 | { | 1320 | { |
1326 | struct scic_sds_remote_device *sci_dev = (struct scic_sds_remote_device *)object; | 1321 | struct scic_sds_remote_device *sci_dev = object; |
1327 | 1322 | ||
1328 | SET_STATE_HANDLER( | 1323 | SET_STATE_HANDLER( |
1329 | sci_dev, | 1324 | sci_dev, |
@@ -1377,11 +1372,10 @@ static void scic_remote_device_construct(struct scic_sds_port *sci_port, | |||
1377 | { | 1372 | { |
1378 | sci_dev->owning_port = sci_port; | 1373 | sci_dev->owning_port = sci_port; |
1379 | sci_dev->started_request_count = 0; | 1374 | sci_dev->started_request_count = 0; |
1380 | sci_dev->parent.private = NULL; | ||
1381 | 1375 | ||
1382 | sci_base_state_machine_construct( | 1376 | sci_base_state_machine_construct( |
1383 | &sci_dev->state_machine, | 1377 | &sci_dev->state_machine, |
1384 | &sci_dev->parent, | 1378 | sci_dev, |
1385 | scic_sds_remote_device_state_table, | 1379 | scic_sds_remote_device_state_table, |
1386 | SCI_BASE_REMOTE_DEVICE_STATE_INITIAL | 1380 | SCI_BASE_REMOTE_DEVICE_STATE_INITIAL |
1387 | ); | 1381 | ); |
@@ -1440,7 +1434,7 @@ static enum sci_status scic_remote_device_da_construct(struct scic_sds_port *sci | |||
1440 | 1434 | ||
1441 | sci_base_state_machine_construct( | 1435 | sci_base_state_machine_construct( |
1442 | &sci_dev->ready_substate_machine, | 1436 | &sci_dev->ready_substate_machine, |
1443 | &sci_dev->parent, | 1437 | sci_dev, |
1444 | scic_sds_stp_remote_device_ready_substate_table, | 1438 | scic_sds_stp_remote_device_ready_substate_table, |
1445 | SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_IDLE); | 1439 | SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_IDLE); |
1446 | } else if (dev_is_expander(dev)) { | 1440 | } else if (dev_is_expander(dev)) { |
@@ -1449,7 +1443,7 @@ static enum sci_status scic_remote_device_da_construct(struct scic_sds_port *sci | |||
1449 | /* add the SMP ready substate machine construction here */ | 1443 | /* add the SMP ready substate machine construction here */ |
1450 | sci_base_state_machine_construct( | 1444 | sci_base_state_machine_construct( |
1451 | &sci_dev->ready_substate_machine, | 1445 | &sci_dev->ready_substate_machine, |
1452 | &sci_dev->parent, | 1446 | sci_dev, |
1453 | scic_sds_smp_remote_device_ready_substate_table, | 1447 | scic_sds_smp_remote_device_ready_substate_table, |
1454 | SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE); | 1448 | SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE); |
1455 | } else | 1449 | } else |
@@ -1497,7 +1491,7 @@ static enum sci_status scic_remote_device_ea_construct(struct scic_sds_port *sci | |||
1497 | /* add the SMP ready substate machine construction here */ | 1491 | /* add the SMP ready substate machine construction here */ |
1498 | sci_base_state_machine_construct( | 1492 | sci_base_state_machine_construct( |
1499 | &sci_dev->ready_substate_machine, | 1493 | &sci_dev->ready_substate_machine, |
1500 | &sci_dev->parent, | 1494 | sci_dev, |
1501 | scic_sds_smp_remote_device_ready_substate_table, | 1495 | scic_sds_smp_remote_device_ready_substate_table, |
1502 | SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE); | 1496 | SCIC_SDS_SMP_REMOTE_DEVICE_READY_SUBSTATE_IDLE); |
1503 | } else if (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP)) { | 1497 | } else if (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP)) { |
@@ -1505,7 +1499,7 @@ static enum sci_status scic_remote_device_ea_construct(struct scic_sds_port *sci | |||
1505 | 1499 | ||
1506 | sci_base_state_machine_construct( | 1500 | sci_base_state_machine_construct( |
1507 | &sci_dev->ready_substate_machine, | 1501 | &sci_dev->ready_substate_machine, |
1508 | &sci_dev->parent, | 1502 | sci_dev, |
1509 | scic_sds_stp_remote_device_ready_substate_table, | 1503 | scic_sds_stp_remote_device_ready_substate_table, |
1510 | SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_IDLE); | 1504 | SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_IDLE); |
1511 | } | 1505 | } |
@@ -1565,9 +1559,6 @@ static enum sci_status isci_remote_device_construct(struct isci_port *iport, | |||
1565 | return status; | 1559 | return status; |
1566 | } | 1560 | } |
1567 | 1561 | ||
1568 | /* XXX will be killed with sci_base_object removal */ | ||
1569 | sci_object_set_association(&idev->sci, idev); | ||
1570 | |||
1571 | /* start the device. */ | 1562 | /* start the device. */ |
1572 | status = scic_remote_device_start(&idev->sci, ISCI_REMOTE_DEVICE_START_TIMEOUT); | 1563 | status = scic_remote_device_start(&idev->sci, ISCI_REMOTE_DEVICE_START_TIMEOUT); |
1573 | 1564 | ||
diff --git a/drivers/scsi/isci/remote_device.h b/drivers/scsi/isci/remote_device.h index 5cceb6c5dc1d..62623c766388 100644 --- a/drivers/scsi/isci/remote_device.h +++ b/drivers/scsi/isci/remote_device.h | |||
@@ -75,12 +75,6 @@ enum scic_remote_device_not_ready_reason_code { | |||
75 | 75 | ||
76 | struct scic_sds_remote_device { | 76 | struct scic_sds_remote_device { |
77 | /** | 77 | /** |
78 | * The field specifies that the parent object for the base remote | ||
79 | * device is the base object itself. | ||
80 | */ | ||
81 | struct sci_base_object parent; | ||
82 | |||
83 | /** | ||
84 | * This field contains the information for the base remote device state | 78 | * This field contains the information for the base remote device state |
85 | * machine. | 79 | * machine. |
86 | */ | 80 | */ |
@@ -417,11 +411,16 @@ static inline struct scic_sds_remote_device *rnc_to_dev(struct scic_sds_remote_n | |||
417 | return sci_dev; | 411 | return sci_dev; |
418 | } | 412 | } |
419 | 413 | ||
420 | static inline struct domain_device *sci_dev_to_domain(struct scic_sds_remote_device *sci_dev) | 414 | static inline struct isci_remote_device *sci_dev_to_idev(struct scic_sds_remote_device *sci_dev) |
421 | { | 415 | { |
422 | struct isci_remote_device *idev = container_of(sci_dev, typeof(*idev), sci); | 416 | struct isci_remote_device *idev = container_of(sci_dev, typeof(*idev), sci); |
423 | 417 | ||
424 | return idev->domain_dev; | 418 | return idev; |
419 | } | ||
420 | |||
421 | static inline struct domain_device *sci_dev_to_domain(struct scic_sds_remote_device *sci_dev) | ||
422 | { | ||
423 | return sci_dev_to_idev(sci_dev)->domain_dev; | ||
425 | } | 424 | } |
426 | 425 | ||
427 | static inline bool dev_is_expander(struct domain_device *dev) | 426 | static inline bool dev_is_expander(struct domain_device *dev) |
diff --git a/drivers/scsi/isci/sci_environment.h b/drivers/scsi/isci/sci_environment.h index 3fb54ddaee1a..41636c34da9e 100644 --- a/drivers/scsi/isci/sci_environment.h +++ b/drivers/scsi/isci/sci_environment.h | |||
@@ -59,7 +59,6 @@ | |||
59 | #include "isci.h" | 59 | #include "isci.h" |
60 | #include "core/scic_sds_controller.h" | 60 | #include "core/scic_sds_controller.h" |
61 | 61 | ||
62 | struct scic_sds_remote_device; | ||
63 | 62 | ||
64 | static inline struct device *scic_to_dev(struct scic_sds_controller *scic) | 63 | static inline struct device *scic_to_dev(struct scic_sds_controller *scic) |
65 | { | 64 | { |
@@ -88,9 +87,11 @@ static inline struct device *sciport_to_dev(struct scic_sds_port *sci_port) | |||
88 | return &iport->isci_host->pdev->dev; | 87 | return &iport->isci_host->pdev->dev; |
89 | } | 88 | } |
90 | 89 | ||
91 | static inline struct device *scirdev_to_dev(struct scic_sds_remote_device *sci_dev) | 90 | static inline struct device *scirdev_to_dev( |
91 | struct scic_sds_remote_device *sci_dev) | ||
92 | { | 92 | { |
93 | struct isci_remote_device *idev = sci_object_get_association(sci_dev); | 93 | struct isci_remote_device *idev = |
94 | container_of(sci_dev, typeof(*idev), sci); | ||
94 | 95 | ||
95 | if (!idev || !idev->isci_port || !idev->isci_port->isci_host) | 96 | if (!idev || !idev->isci_port || !idev->isci_port->isci_host) |
96 | return NULL; | 97 | return NULL; |
diff --git a/drivers/scsi/isci/smp_remote_device.c b/drivers/scsi/isci/smp_remote_device.c index aae5c80c1341..45340a5c99c7 100644 --- a/drivers/scsi/isci/smp_remote_device.c +++ b/drivers/scsi/isci/smp_remote_device.c | |||
@@ -246,11 +246,10 @@ static const struct scic_sds_remote_device_state_handler scic_sds_smp_remote_dev | |||
246 | */ | 246 | */ |
247 | static void scic_sds_smp_remote_device_ready_idle_substate_enter(void *object) | 247 | static void scic_sds_smp_remote_device_ready_idle_substate_enter(void *object) |
248 | { | 248 | { |
249 | struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev), | 249 | struct scic_sds_remote_device *sci_dev = object; |
250 | parent); | ||
251 | struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); | 250 | struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); |
252 | struct isci_host *ihost = scic->ihost; | 251 | struct isci_host *ihost = scic->ihost; |
253 | struct isci_remote_device *idev = sci_object_get_association(sci_dev); | 252 | struct isci_remote_device *idev = sci_dev_to_idev(sci_dev); |
254 | 253 | ||
255 | SET_STATE_HANDLER(sci_dev, | 254 | SET_STATE_HANDLER(sci_dev, |
256 | scic_sds_smp_remote_device_ready_substate_handler_table, | 255 | scic_sds_smp_remote_device_ready_substate_handler_table, |
@@ -270,11 +269,10 @@ static void scic_sds_smp_remote_device_ready_idle_substate_enter(void *object) | |||
270 | */ | 269 | */ |
271 | static void scic_sds_smp_remote_device_ready_cmd_substate_enter(void *object) | 270 | static void scic_sds_smp_remote_device_ready_cmd_substate_enter(void *object) |
272 | { | 271 | { |
273 | struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev), | 272 | struct scic_sds_remote_device *sci_dev = object; |
274 | parent); | ||
275 | struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); | 273 | struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); |
276 | struct isci_host *ihost = scic->ihost; | 274 | struct isci_host *ihost = scic->ihost; |
277 | struct isci_remote_device *idev = sci_object_get_association(sci_dev); | 275 | struct isci_remote_device *idev = sci_dev_to_idev(sci_dev); |
278 | 276 | ||
279 | BUG_ON(sci_dev->working_request == NULL); | 277 | BUG_ON(sci_dev->working_request == NULL); |
280 | 278 | ||
@@ -295,8 +293,7 @@ static void scic_sds_smp_remote_device_ready_cmd_substate_enter(void *object) | |||
295 | */ | 293 | */ |
296 | static void scic_sds_smp_remote_device_ready_cmd_substate_exit(void *object) | 294 | static void scic_sds_smp_remote_device_ready_cmd_substate_exit(void *object) |
297 | { | 295 | { |
298 | struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev), | 296 | struct scic_sds_remote_device *sci_dev = object; |
299 | parent); | ||
300 | sci_dev->working_request = NULL; | 297 | sci_dev->working_request = NULL; |
301 | } | 298 | } |
302 | 299 | ||
diff --git a/drivers/scsi/isci/stp_remote_device.c b/drivers/scsi/isci/stp_remote_device.c index c1c2f9b87cac..d86976469428 100644 --- a/drivers/scsi/isci/stp_remote_device.c +++ b/drivers/scsi/isci/stp_remote_device.c | |||
@@ -580,7 +580,7 @@ static void | |||
580 | scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler(void *user_cookie) | 580 | scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler(void *user_cookie) |
581 | { | 581 | { |
582 | struct scic_sds_remote_device *sci_dev = user_cookie; | 582 | struct scic_sds_remote_device *sci_dev = user_cookie; |
583 | struct isci_remote_device *idev = sci_object_get_association(sci_dev); | 583 | struct isci_remote_device *idev = sci_dev_to_idev(sci_dev); |
584 | struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); | 584 | struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); |
585 | struct isci_host *ihost = scic->ihost; | 585 | struct isci_host *ihost = scic->ihost; |
586 | 586 | ||
@@ -607,9 +607,7 @@ scic_sds_stp_remote_device_ready_idle_substate_resume_complete_handler(void *use | |||
607 | */ | 607 | */ |
608 | static void scic_sds_stp_remote_device_ready_idle_substate_enter(void *device) | 608 | static void scic_sds_stp_remote_device_ready_idle_substate_enter(void *device) |
609 | { | 609 | { |
610 | struct scic_sds_remote_device *sci_dev; | 610 | struct scic_sds_remote_device *sci_dev = device; |
611 | |||
612 | sci_dev = (struct scic_sds_remote_device *)device; | ||
613 | 611 | ||
614 | SET_STATE_HANDLER( | 612 | SET_STATE_HANDLER( |
615 | sci_dev, | 613 | sci_dev, |
@@ -636,11 +634,10 @@ static void scic_sds_stp_remote_device_ready_idle_substate_enter(void *device) | |||
636 | 634 | ||
637 | static void scic_sds_stp_remote_device_ready_cmd_substate_enter(void *object) | 635 | static void scic_sds_stp_remote_device_ready_cmd_substate_enter(void *object) |
638 | { | 636 | { |
639 | struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev), | 637 | struct scic_sds_remote_device *sci_dev = object; |
640 | parent); | ||
641 | struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); | 638 | struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); |
642 | struct isci_host *ihost = scic->ihost; | 639 | struct isci_host *ihost = scic->ihost; |
643 | struct isci_remote_device *idev = sci_object_get_association(sci_dev); | 640 | struct isci_remote_device *idev = sci_dev_to_idev(sci_dev); |
644 | 641 | ||
645 | BUG_ON(sci_dev->working_request == NULL); | 642 | BUG_ON(sci_dev->working_request == NULL); |
646 | 643 | ||
@@ -654,8 +651,7 @@ static void scic_sds_stp_remote_device_ready_cmd_substate_enter(void *object) | |||
654 | 651 | ||
655 | static void scic_sds_stp_remote_device_ready_ncq_substate_enter(void *object) | 652 | static void scic_sds_stp_remote_device_ready_ncq_substate_enter(void *object) |
656 | { | 653 | { |
657 | struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev), | 654 | struct scic_sds_remote_device *sci_dev = object; |
658 | parent); | ||
659 | SET_STATE_HANDLER(sci_dev, | 655 | SET_STATE_HANDLER(sci_dev, |
660 | scic_sds_stp_remote_device_ready_substate_handler_table, | 656 | scic_sds_stp_remote_device_ready_substate_handler_table, |
661 | SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ); | 657 | SCIC_SDS_STP_REMOTE_DEVICE_READY_SUBSTATE_NCQ); |
@@ -664,11 +660,10 @@ static void scic_sds_stp_remote_device_ready_ncq_substate_enter(void *object) | |||
664 | static void scic_sds_stp_remote_device_ready_ncq_error_substate_enter( | 660 | static void scic_sds_stp_remote_device_ready_ncq_error_substate_enter( |
665 | void *object) | 661 | void *object) |
666 | { | 662 | { |
667 | struct scic_sds_remote_device *sci_dev = container_of(object, typeof(*sci_dev), | 663 | struct scic_sds_remote_device *sci_dev = object; |
668 | parent); | ||
669 | struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); | 664 | struct scic_sds_controller *scic = scic_sds_remote_device_get_controller(sci_dev); |
670 | struct isci_host *ihost = scic->ihost; | 665 | struct isci_host *ihost = scic->ihost; |
671 | struct isci_remote_device *idev = sci_object_get_association(sci_dev); | 666 | struct isci_remote_device *idev = sci_dev_to_idev(sci_dev); |
672 | 667 | ||
673 | SET_STATE_HANDLER(sci_dev, | 668 | SET_STATE_HANDLER(sci_dev, |
674 | scic_sds_stp_remote_device_ready_substate_handler_table, | 669 | scic_sds_stp_remote_device_ready_substate_handler_table, |