Commit 9614395e authored by Dan Williams's avatar Dan Williams

isci: remove rnc->device back pointer

Now that they are one in the same object remove the back pointer reference
in favor of container_of.
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 7ab92c9e
......@@ -1672,11 +1672,8 @@ void scic_remote_device_construct(struct scic_sds_port *sci_port,
&sci_dev->state_machine
);
scic_sds_remote_node_context_construct(
sci_dev,
&sci_dev->rnc,
SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX
);
scic_sds_remote_node_context_construct(&sci_dev->rnc,
SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX);
sci_object_set_association(&sci_dev->rnc, sci_dev);
}
......@@ -339,6 +339,15 @@ struct scic_sds_remote_device {
const struct scic_sds_remote_device_state_handler *state_handlers;
};
static inline struct scic_sds_remote_device *rnc_to_dev(struct scic_sds_remote_node_context *rnc)
{
struct scic_sds_remote_device *sci_dev;
sci_dev = container_of(rnc, typeof(*sci_dev), rnc);
return sci_dev;
}
typedef enum sci_status (*scic_sds_remote_device_request_handler_t)(
struct scic_sds_remote_device *device,
struct scic_sds_request *request);
......
......@@ -231,15 +231,6 @@ struct scic_sds_remote_node_context {
*/
struct sci_base_object parent;
/**
* This pointer simply points to the remote device object containing
* this RNC.
*
* @todo Consider making the device pointer the associated object of the
* the parent object.
*/
struct scic_sds_remote_device *device;
/**
* This field indicates the remote node index (RNI) associated with
* this RNC.
......@@ -279,10 +270,8 @@ struct scic_sds_remote_node_context {
struct scic_sds_remote_node_context_handlers *state_handlers;
};
void scic_sds_remote_node_context_construct(
struct scic_sds_remote_device *device,
struct scic_sds_remote_node_context *rnc,
u16 remote_node_index);
void scic_sds_remote_node_context_construct(struct scic_sds_remote_node_context *rnc,
u16 remote_node_index);
bool scic_sds_remote_node_context_is_ready(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment