[SCSI] zfcp: Access ports and units with container_of in sysfs code

When accessing port and unit attributes, use container_of instead of
dev_get_drvdata. This eliminates some code checker warnings about
aliased access of data structures.

Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
This commit is contained in:
Christof Schmitt
2009-11-24 16:54:02 +01:00
committed by James Bottomley
parent b42aeceb35
commit 25458eb791
2 changed files with 10 additions and 7 deletions

View File

@@ -319,7 +319,6 @@ struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *port, u64 fcp_lun)
kfree(unit);
goto err_out;
}
dev_set_drvdata(&unit->sysfs_device, unit);
retval = -EINVAL;
/* mark unit unusable as long as sysfs registration is not complete */
@@ -688,7 +687,6 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn,
kfree(port);
goto err_out;
}
dev_set_drvdata(&port->sysfs_device, port);
retval = -EINVAL;
if (device_register(&port->sysfs_device)) {