aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/s390/scsi/zfcp_aux.c2
-rw-r--r--drivers/s390/scsi/zfcp_sysfs.c15
2 files changed, 10 insertions, 7 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index ed31bd0ff3fb..baef2ec7482f 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -319,7 +319,6 @@ struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *port, u64 fcp_lun)
319 kfree(unit); 319 kfree(unit);
320 goto err_out; 320 goto err_out;
321 } 321 }
322 dev_set_drvdata(&unit->sysfs_device, unit);
323 retval = -EINVAL; 322 retval = -EINVAL;
324 323
325 /* mark unit unusable as long as sysfs registration is not complete */ 324 /* 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,
688 kfree(port); 687 kfree(port);
689 goto err_out; 688 goto err_out;
690 } 689 }
691 dev_set_drvdata(&port->sysfs_device, port);
692 retval = -EINVAL; 690 retval = -EINVAL;
693 691
694 if (device_register(&port->sysfs_device)) { 692 if (device_register(&port->sysfs_device)) {
diff --git a/drivers/s390/scsi/zfcp_sysfs.c b/drivers/s390/scsi/zfcp_sysfs.c
index 181bea0f10fb..901cc9a6ed20 100644
--- a/drivers/s390/scsi/zfcp_sysfs.c
+++ b/drivers/s390/scsi/zfcp_sysfs.c
@@ -19,7 +19,8 @@ static ssize_t zfcp_sysfs_##_feat##_##_name##_show(struct device *dev, \
19 struct device_attribute *at,\ 19 struct device_attribute *at,\
20 char *buf) \ 20 char *buf) \
21{ \ 21{ \
22 struct _feat_def *_feat = dev_get_drvdata(dev); \ 22 struct _feat_def *_feat = container_of(dev, struct _feat_def, \
23 sysfs_device); \
23 \ 24 \
24 return sprintf(buf, _format, _value); \ 25 return sprintf(buf, _format, _value); \
25} \ 26} \
@@ -86,7 +87,8 @@ static ssize_t zfcp_sysfs_##_feat##_failed_show(struct device *dev, \
86 struct device_attribute *attr, \ 87 struct device_attribute *attr, \
87 char *buf) \ 88 char *buf) \
88{ \ 89{ \
89 struct _feat_def *_feat = dev_get_drvdata(dev); \ 90 struct _feat_def *_feat = container_of(dev, struct _feat_def, \
91 sysfs_device); \
90 \ 92 \
91 if (atomic_read(&_feat->status) & ZFCP_STATUS_COMMON_ERP_FAILED) \ 93 if (atomic_read(&_feat->status) & ZFCP_STATUS_COMMON_ERP_FAILED) \
92 return sprintf(buf, "1\n"); \ 94 return sprintf(buf, "1\n"); \
@@ -97,7 +99,8 @@ static ssize_t zfcp_sysfs_##_feat##_failed_store(struct device *dev, \
97 struct device_attribute *attr,\ 99 struct device_attribute *attr,\
98 const char *buf, size_t count)\ 100 const char *buf, size_t count)\
99{ \ 101{ \
100 struct _feat_def *_feat = dev_get_drvdata(dev); \ 102 struct _feat_def *_feat = container_of(dev, struct _feat_def, \
103 sysfs_device); \
101 unsigned long val; \ 104 unsigned long val; \
102 int retval = 0; \ 105 int retval = 0; \
103 \ 106 \
@@ -274,7 +277,8 @@ static ssize_t zfcp_sysfs_unit_add_store(struct device *dev,
274 struct device_attribute *attr, 277 struct device_attribute *attr,
275 const char *buf, size_t count) 278 const char *buf, size_t count)
276{ 279{
277 struct zfcp_port *port = dev_get_drvdata(dev); 280 struct zfcp_port *port = container_of(dev, struct zfcp_port,
281 sysfs_device);
278 struct zfcp_unit *unit; 282 struct zfcp_unit *unit;
279 u64 fcp_lun; 283 u64 fcp_lun;
280 int retval = -EINVAL; 284 int retval = -EINVAL;
@@ -305,7 +309,8 @@ static ssize_t zfcp_sysfs_unit_remove_store(struct device *dev,
305 struct device_attribute *attr, 309 struct device_attribute *attr,
306 const char *buf, size_t count) 310 const char *buf, size_t count)
307{ 311{
308 struct zfcp_port *port = dev_get_drvdata(dev); 312 struct zfcp_port *port = container_of(dev, struct zfcp_port,
313 sysfs_device);
309 struct zfcp_unit *unit; 314 struct zfcp_unit *unit;
310 u64 fcp_lun; 315 u64 fcp_lun;
311 int retval = 0; 316 int retval = 0;