diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2010-02-17 05:18:56 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-02-17 18:46:30 -0500 |
commit | 615f59e0daaf56e43dcaaf3ea228967d9bc21584 (patch) | |
tree | 846366936a5077153b8f07b3125e868d7f6bce4e | |
parent | 5bdecd2248d4af6f3b311b4d8ca7f3f5f83a7191 (diff) |
[SCSI] zfcp: Rename sysfs_device attribute to dev in zfcp_unit and zfcp_port
Kernel code uses dev as short name for the struct device. Rename the
sysfs_device in zfcp_unit and zfcp_port to match this convention.
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>
-rw-r--r-- | drivers/s390/scsi/zfcp_aux.c | 54 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_ccw.c | 8 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_def.h | 6 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_erp.c | 14 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fc.c | 23 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 14 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_scsi.c | 18 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_sysfs.c | 37 |
8 files changed, 81 insertions, 93 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index f42da9d57093..66d6c01fcf3e 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Module interface and handling of zfcp data structures. | 4 | * Module interface and handling of zfcp data structures. |
5 | * | 5 | * |
6 | * Copyright IBM Corporation 2002, 2009 | 6 | * Copyright IBM Corporation 2002, 2010 |
7 | */ | 7 | */ |
8 | 8 | ||
9 | /* | 9 | /* |
@@ -81,7 +81,7 @@ static void __init zfcp_init_device_configure(char *busid, u64 wwpn, u64 lun) | |||
81 | flush_work(&unit->scsi_work); | 81 | flush_work(&unit->scsi_work); |
82 | 82 | ||
83 | out_unit: | 83 | out_unit: |
84 | put_device(&port->sysfs_device); | 84 | put_device(&port->dev); |
85 | out_port: | 85 | out_port: |
86 | zfcp_ccw_adapter_put(adapter); | 86 | zfcp_ccw_adapter_put(adapter); |
87 | out_ccw_device: | 87 | out_ccw_device: |
@@ -226,7 +226,7 @@ struct zfcp_unit *zfcp_get_unit_by_lun(struct zfcp_port *port, u64 fcp_lun) | |||
226 | read_lock_irqsave(&port->unit_list_lock, flags); | 226 | read_lock_irqsave(&port->unit_list_lock, flags); |
227 | list_for_each_entry(unit, &port->unit_list, list) | 227 | list_for_each_entry(unit, &port->unit_list, list) |
228 | if (unit->fcp_lun == fcp_lun) { | 228 | if (unit->fcp_lun == fcp_lun) { |
229 | if (!get_device(&unit->sysfs_device)) | 229 | if (!get_device(&unit->dev)) |
230 | unit = NULL; | 230 | unit = NULL; |
231 | read_unlock_irqrestore(&port->unit_list_lock, flags); | 231 | read_unlock_irqrestore(&port->unit_list_lock, flags); |
232 | return unit; | 232 | return unit; |
@@ -251,7 +251,7 @@ struct zfcp_port *zfcp_get_port_by_wwpn(struct zfcp_adapter *adapter, | |||
251 | read_lock_irqsave(&adapter->port_list_lock, flags); | 251 | read_lock_irqsave(&adapter->port_list_lock, flags); |
252 | list_for_each_entry(port, &adapter->port_list, list) | 252 | list_for_each_entry(port, &adapter->port_list, list) |
253 | if (port->wwpn == wwpn) { | 253 | if (port->wwpn == wwpn) { |
254 | if (!get_device(&port->sysfs_device)) | 254 | if (!get_device(&port->dev)) |
255 | port = NULL; | 255 | port = NULL; |
256 | read_unlock_irqrestore(&adapter->port_list_lock, flags); | 256 | read_unlock_irqrestore(&adapter->port_list_lock, flags); |
257 | return port; | 257 | return port; |
@@ -269,10 +269,9 @@ struct zfcp_port *zfcp_get_port_by_wwpn(struct zfcp_adapter *adapter, | |||
269 | */ | 269 | */ |
270 | static void zfcp_unit_release(struct device *dev) | 270 | static void zfcp_unit_release(struct device *dev) |
271 | { | 271 | { |
272 | struct zfcp_unit *unit = container_of(dev, struct zfcp_unit, | 272 | struct zfcp_unit *unit = container_of(dev, struct zfcp_unit, dev); |
273 | sysfs_device); | ||
274 | 273 | ||
275 | put_device(&unit->port->sysfs_device); | 274 | put_device(&unit->port->dev); |
276 | kfree(unit); | 275 | kfree(unit); |
277 | } | 276 | } |
278 | 277 | ||
@@ -289,11 +288,11 @@ struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *port, u64 fcp_lun) | |||
289 | struct zfcp_unit *unit; | 288 | struct zfcp_unit *unit; |
290 | int retval = -ENOMEM; | 289 | int retval = -ENOMEM; |
291 | 290 | ||
292 | get_device(&port->sysfs_device); | 291 | get_device(&port->dev); |
293 | 292 | ||
294 | unit = zfcp_get_unit_by_lun(port, fcp_lun); | 293 | unit = zfcp_get_unit_by_lun(port, fcp_lun); |
295 | if (unit) { | 294 | if (unit) { |
296 | put_device(&unit->sysfs_device); | 295 | put_device(&unit->dev); |
297 | retval = -EEXIST; | 296 | retval = -EEXIST; |
298 | goto err_out; | 297 | goto err_out; |
299 | } | 298 | } |
@@ -304,10 +303,10 @@ struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *port, u64 fcp_lun) | |||
304 | 303 | ||
305 | unit->port = port; | 304 | unit->port = port; |
306 | unit->fcp_lun = fcp_lun; | 305 | unit->fcp_lun = fcp_lun; |
307 | unit->sysfs_device.parent = &port->sysfs_device; | 306 | unit->dev.parent = &port->dev; |
308 | unit->sysfs_device.release = zfcp_unit_release; | 307 | unit->dev.release = zfcp_unit_release; |
309 | 308 | ||
310 | if (dev_set_name(&unit->sysfs_device, "0x%016llx", | 309 | if (dev_set_name(&unit->dev, "0x%016llx", |
311 | (unsigned long long) fcp_lun)) { | 310 | (unsigned long long) fcp_lun)) { |
312 | kfree(unit); | 311 | kfree(unit); |
313 | goto err_out; | 312 | goto err_out; |
@@ -324,13 +323,12 @@ struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *port, u64 fcp_lun) | |||
324 | unit->latencies.cmd.channel.min = 0xFFFFFFFF; | 323 | unit->latencies.cmd.channel.min = 0xFFFFFFFF; |
325 | unit->latencies.cmd.fabric.min = 0xFFFFFFFF; | 324 | unit->latencies.cmd.fabric.min = 0xFFFFFFFF; |
326 | 325 | ||
327 | if (device_register(&unit->sysfs_device)) { | 326 | if (device_register(&unit->dev)) { |
328 | put_device(&unit->sysfs_device); | 327 | put_device(&unit->dev); |
329 | goto err_out; | 328 | goto err_out; |
330 | } | 329 | } |
331 | 330 | ||
332 | if (sysfs_create_group(&unit->sysfs_device.kobj, | 331 | if (sysfs_create_group(&unit->dev.kobj, &zfcp_sysfs_unit_attrs)) |
333 | &zfcp_sysfs_unit_attrs)) | ||
334 | goto err_out_put; | 332 | goto err_out_put; |
335 | 333 | ||
336 | write_lock_irq(&port->unit_list_lock); | 334 | write_lock_irq(&port->unit_list_lock); |
@@ -342,9 +340,9 @@ struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *port, u64 fcp_lun) | |||
342 | return unit; | 340 | return unit; |
343 | 341 | ||
344 | err_out_put: | 342 | err_out_put: |
345 | device_unregister(&unit->sysfs_device); | 343 | device_unregister(&unit->dev); |
346 | err_out: | 344 | err_out: |
347 | put_device(&port->sysfs_device); | 345 | put_device(&port->dev); |
348 | return ERR_PTR(retval); | 346 | return ERR_PTR(retval); |
349 | } | 347 | } |
350 | 348 | ||
@@ -610,8 +608,7 @@ void zfcp_device_unregister(struct device *dev, | |||
610 | 608 | ||
611 | static void zfcp_port_release(struct device *dev) | 609 | static void zfcp_port_release(struct device *dev) |
612 | { | 610 | { |
613 | struct zfcp_port *port = container_of(dev, struct zfcp_port, | 611 | struct zfcp_port *port = container_of(dev, struct zfcp_port, dev); |
614 | sysfs_device); | ||
615 | 612 | ||
616 | zfcp_ccw_adapter_put(port->adapter); | 613 | zfcp_ccw_adapter_put(port->adapter); |
617 | kfree(port); | 614 | kfree(port); |
@@ -639,7 +636,7 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn, | |||
639 | 636 | ||
640 | port = zfcp_get_port_by_wwpn(adapter, wwpn); | 637 | port = zfcp_get_port_by_wwpn(adapter, wwpn); |
641 | if (port) { | 638 | if (port) { |
642 | put_device(&port->sysfs_device); | 639 | put_device(&port->dev); |
643 | retval = -EEXIST; | 640 | retval = -EEXIST; |
644 | goto err_out; | 641 | goto err_out; |
645 | } | 642 | } |
@@ -659,22 +656,21 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn, | |||
659 | port->d_id = d_id; | 656 | port->d_id = d_id; |
660 | port->wwpn = wwpn; | 657 | port->wwpn = wwpn; |
661 | port->rport_task = RPORT_NONE; | 658 | port->rport_task = RPORT_NONE; |
662 | port->sysfs_device.parent = &adapter->ccw_device->dev; | 659 | port->dev.parent = &adapter->ccw_device->dev; |
663 | port->sysfs_device.release = zfcp_port_release; | 660 | port->dev.release = zfcp_port_release; |
664 | 661 | ||
665 | if (dev_set_name(&port->sysfs_device, "0x%016llx", | 662 | if (dev_set_name(&port->dev, "0x%016llx", (unsigned long long)wwpn)) { |
666 | (unsigned long long)wwpn)) { | ||
667 | kfree(port); | 663 | kfree(port); |
668 | goto err_out; | 664 | goto err_out; |
669 | } | 665 | } |
670 | retval = -EINVAL; | 666 | retval = -EINVAL; |
671 | 667 | ||
672 | if (device_register(&port->sysfs_device)) { | 668 | if (device_register(&port->dev)) { |
673 | put_device(&port->sysfs_device); | 669 | put_device(&port->dev); |
674 | goto err_out; | 670 | goto err_out; |
675 | } | 671 | } |
676 | 672 | ||
677 | if (sysfs_create_group(&port->sysfs_device.kobj, | 673 | if (sysfs_create_group(&port->dev.kobj, |
678 | &zfcp_sysfs_port_attrs)) | 674 | &zfcp_sysfs_port_attrs)) |
679 | goto err_out_put; | 675 | goto err_out_put; |
680 | 676 | ||
@@ -687,7 +683,7 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn, | |||
687 | return port; | 683 | return port; |
688 | 684 | ||
689 | err_out_put: | 685 | err_out_put: |
690 | device_unregister(&port->sysfs_device); | 686 | device_unregister(&port->dev); |
691 | err_out: | 687 | err_out: |
692 | zfcp_ccw_adapter_put(adapter); | 688 | zfcp_ccw_adapter_put(adapter); |
693 | return ERR_PTR(retval); | 689 | return ERR_PTR(retval); |
diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c index 6f65a2179537..ce1cc7a11fb4 100644 --- a/drivers/s390/scsi/zfcp_ccw.c +++ b/drivers/s390/scsi/zfcp_ccw.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Registration and callback for the s390 common I/O layer. | 4 | * Registration and callback for the s390 common I/O layer. |
5 | * | 5 | * |
6 | * Copyright IBM Corporation 2002, 2009 | 6 | * Copyright IBM Corporation 2002, 2010 |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #define KMSG_COMPONENT "zfcp" | 9 | #define KMSG_COMPONENT "zfcp" |
@@ -123,12 +123,10 @@ static void zfcp_ccw_remove(struct ccw_device *cdev) | |||
123 | zfcp_ccw_adapter_put(adapter); /* put from zfcp_ccw_adapter_by_cdev */ | 123 | zfcp_ccw_adapter_put(adapter); /* put from zfcp_ccw_adapter_by_cdev */ |
124 | 124 | ||
125 | list_for_each_entry_safe(unit, u, &unit_remove_lh, list) | 125 | list_for_each_entry_safe(unit, u, &unit_remove_lh, list) |
126 | zfcp_device_unregister(&unit->sysfs_device, | 126 | zfcp_device_unregister(&unit->dev, &zfcp_sysfs_unit_attrs); |
127 | &zfcp_sysfs_unit_attrs); | ||
128 | 127 | ||
129 | list_for_each_entry_safe(port, p, &port_remove_lh, list) | 128 | list_for_each_entry_safe(port, p, &port_remove_lh, list) |
130 | zfcp_device_unregister(&port->sysfs_device, | 129 | zfcp_device_unregister(&port->dev, &zfcp_sysfs_port_attrs); |
131 | &zfcp_sysfs_port_attrs); | ||
132 | 130 | ||
133 | zfcp_adapter_unregister(adapter); | 131 | zfcp_adapter_unregister(adapter); |
134 | } | 132 | } |
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index ff4e2ca19beb..f43e6d8c9cea 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Global definitions for the zfcp device driver. | 4 | * Global definitions for the zfcp device driver. |
5 | * | 5 | * |
6 | * Copyright IBM Corporation 2002, 2009 | 6 | * Copyright IBM Corporation 2002, 2010 |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #ifndef ZFCP_DEF_H | 9 | #ifndef ZFCP_DEF_H |
@@ -237,7 +237,7 @@ struct zfcp_adapter { | |||
237 | }; | 237 | }; |
238 | 238 | ||
239 | struct zfcp_port { | 239 | struct zfcp_port { |
240 | struct device sysfs_device; /* sysfs device */ | 240 | struct device dev; |
241 | struct fc_rport *rport; /* rport of fc transport class */ | 241 | struct fc_rport *rport; /* rport of fc transport class */ |
242 | struct list_head list; /* list of remote ports */ | 242 | struct list_head list; /* list of remote ports */ |
243 | struct zfcp_adapter *adapter; /* adapter used to access port */ | 243 | struct zfcp_adapter *adapter; /* adapter used to access port */ |
@@ -259,7 +259,7 @@ struct zfcp_port { | |||
259 | }; | 259 | }; |
260 | 260 | ||
261 | struct zfcp_unit { | 261 | struct zfcp_unit { |
262 | struct device sysfs_device; /* sysfs device */ | 262 | struct device dev; |
263 | struct list_head list; /* list of logical units */ | 263 | struct list_head list; /* list of logical units */ |
264 | struct zfcp_port *port; /* remote port of unit */ | 264 | struct zfcp_port *port; /* remote port of unit */ |
265 | atomic_t status; /* status of this logical unit */ | 265 | atomic_t status; /* status of this logical unit */ |
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index fe8e4c2b9563..0be5e7ea2828 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Error Recovery Procedures (ERP). | 4 | * Error Recovery Procedures (ERP). |
5 | * | 5 | * |
6 | * Copyright IBM Corporation 2002, 2009 | 6 | * Copyright IBM Corporation 2002, 2010 |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #define KMSG_COMPONENT "zfcp" | 9 | #define KMSG_COMPONENT "zfcp" |
@@ -175,7 +175,7 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, | |||
175 | 175 | ||
176 | switch (need) { | 176 | switch (need) { |
177 | case ZFCP_ERP_ACTION_REOPEN_UNIT: | 177 | case ZFCP_ERP_ACTION_REOPEN_UNIT: |
178 | if (!get_device(&unit->sysfs_device)) | 178 | if (!get_device(&unit->dev)) |
179 | return NULL; | 179 | return NULL; |
180 | atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &unit->status); | 180 | atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &unit->status); |
181 | erp_action = &unit->erp_action; | 181 | erp_action = &unit->erp_action; |
@@ -185,7 +185,7 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, | |||
185 | 185 | ||
186 | case ZFCP_ERP_ACTION_REOPEN_PORT: | 186 | case ZFCP_ERP_ACTION_REOPEN_PORT: |
187 | case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: | 187 | case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: |
188 | if (!get_device(&port->sysfs_device)) | 188 | if (!get_device(&port->dev)) |
189 | return NULL; | 189 | return NULL; |
190 | zfcp_erp_action_dismiss_port(port); | 190 | zfcp_erp_action_dismiss_port(port); |
191 | atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &port->status); | 191 | atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &port->status); |
@@ -1181,19 +1181,19 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result) | |||
1181 | switch (act->action) { | 1181 | switch (act->action) { |
1182 | case ZFCP_ERP_ACTION_REOPEN_UNIT: | 1182 | case ZFCP_ERP_ACTION_REOPEN_UNIT: |
1183 | if ((result == ZFCP_ERP_SUCCEEDED) && !unit->device) { | 1183 | if ((result == ZFCP_ERP_SUCCEEDED) && !unit->device) { |
1184 | get_device(&unit->sysfs_device); | 1184 | get_device(&unit->dev); |
1185 | if (scsi_queue_work(unit->port->adapter->scsi_host, | 1185 | if (scsi_queue_work(unit->port->adapter->scsi_host, |
1186 | &unit->scsi_work) <= 0) | 1186 | &unit->scsi_work) <= 0) |
1187 | put_device(&unit->sysfs_device); | 1187 | put_device(&unit->dev); |
1188 | } | 1188 | } |
1189 | put_device(&unit->sysfs_device); | 1189 | put_device(&unit->dev); |
1190 | break; | 1190 | break; |
1191 | 1191 | ||
1192 | case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: | 1192 | case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: |
1193 | case ZFCP_ERP_ACTION_REOPEN_PORT: | 1193 | case ZFCP_ERP_ACTION_REOPEN_PORT: |
1194 | if (result == ZFCP_ERP_SUCCEEDED) | 1194 | if (result == ZFCP_ERP_SUCCEEDED) |
1195 | zfcp_scsi_schedule_rport_register(port); | 1195 | zfcp_scsi_schedule_rport_register(port); |
1196 | put_device(&port->sysfs_device); | 1196 | put_device(&port->dev); |
1197 | break; | 1197 | break; |
1198 | 1198 | ||
1199 | case ZFCP_ERP_ACTION_REOPEN_ADAPTER: | 1199 | case ZFCP_ERP_ACTION_REOPEN_ADAPTER: |
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c index 0f7b493fb105..f28700a03d75 100644 --- a/drivers/s390/scsi/zfcp_fc.c +++ b/drivers/s390/scsi/zfcp_fc.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Fibre Channel related functions for the zfcp device driver. | 4 | * Fibre Channel related functions for the zfcp device driver. |
5 | * | 5 | * |
6 | * Copyright IBM Corporation 2008, 2009 | 6 | * Copyright IBM Corporation 2008, 2010 |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #define KMSG_COMPONENT "zfcp" | 9 | #define KMSG_COMPONENT "zfcp" |
@@ -316,7 +316,7 @@ void zfcp_fc_port_did_lookup(struct work_struct *work) | |||
316 | 316 | ||
317 | zfcp_erp_port_reopen(port, 0, "fcgpn_3", NULL); | 317 | zfcp_erp_port_reopen(port, 0, "fcgpn_3", NULL); |
318 | out: | 318 | out: |
319 | put_device(&port->sysfs_device); | 319 | put_device(&port->dev); |
320 | } | 320 | } |
321 | 321 | ||
322 | /** | 322 | /** |
@@ -325,9 +325,9 @@ out: | |||
325 | */ | 325 | */ |
326 | void zfcp_fc_trigger_did_lookup(struct zfcp_port *port) | 326 | void zfcp_fc_trigger_did_lookup(struct zfcp_port *port) |
327 | { | 327 | { |
328 | get_device(&port->sysfs_device); | 328 | get_device(&port->dev); |
329 | if (!queue_work(port->adapter->work_queue, &port->gid_pn_work)) | 329 | if (!queue_work(port->adapter->work_queue, &port->gid_pn_work)) |
330 | put_device(&port->sysfs_device); | 330 | put_device(&port->dev); |
331 | } | 331 | } |
332 | 332 | ||
333 | /** | 333 | /** |
@@ -389,7 +389,7 @@ static void zfcp_fc_adisc_handler(void *data) | |||
389 | zfcp_scsi_schedule_rport_register(port); | 389 | zfcp_scsi_schedule_rport_register(port); |
390 | out: | 390 | out: |
391 | atomic_clear_mask(ZFCP_STATUS_PORT_LINK_TEST, &port->status); | 391 | atomic_clear_mask(ZFCP_STATUS_PORT_LINK_TEST, &port->status); |
392 | put_device(&port->sysfs_device); | 392 | put_device(&port->dev); |
393 | kmem_cache_free(zfcp_data.adisc_cache, adisc); | 393 | kmem_cache_free(zfcp_data.adisc_cache, adisc); |
394 | } | 394 | } |
395 | 395 | ||
@@ -436,7 +436,7 @@ void zfcp_fc_link_test_work(struct work_struct *work) | |||
436 | container_of(work, struct zfcp_port, test_link_work); | 436 | container_of(work, struct zfcp_port, test_link_work); |
437 | int retval; | 437 | int retval; |
438 | 438 | ||
439 | get_device(&port->sysfs_device); | 439 | get_device(&port->dev); |
440 | port->rport_task = RPORT_DEL; | 440 | port->rport_task = RPORT_DEL; |
441 | zfcp_scsi_rport_work(&port->rport_work); | 441 | zfcp_scsi_rport_work(&port->rport_work); |
442 | 442 | ||
@@ -455,7 +455,7 @@ void zfcp_fc_link_test_work(struct work_struct *work) | |||
455 | zfcp_erp_port_forced_reopen(port, 0, "fcltwk1", NULL); | 455 | zfcp_erp_port_forced_reopen(port, 0, "fcltwk1", NULL); |
456 | 456 | ||
457 | out: | 457 | out: |
458 | put_device(&port->sysfs_device); | 458 | put_device(&port->dev); |
459 | } | 459 | } |
460 | 460 | ||
461 | /** | 461 | /** |
@@ -468,9 +468,9 @@ out: | |||
468 | */ | 468 | */ |
469 | void zfcp_fc_test_link(struct zfcp_port *port) | 469 | void zfcp_fc_test_link(struct zfcp_port *port) |
470 | { | 470 | { |
471 | get_device(&port->sysfs_device); | 471 | get_device(&port->dev); |
472 | if (!queue_work(port->adapter->work_queue, &port->test_link_work)) | 472 | if (!queue_work(port->adapter->work_queue, &port->test_link_work)) |
473 | put_device(&port->sysfs_device); | 473 | put_device(&port->dev); |
474 | } | 474 | } |
475 | 475 | ||
476 | static void zfcp_free_sg_env(struct zfcp_fc_gpn_ft *gpn_ft, int buf_num) | 476 | static void zfcp_free_sg_env(struct zfcp_fc_gpn_ft *gpn_ft, int buf_num) |
@@ -617,8 +617,7 @@ static int zfcp_fc_eval_gpn_ft(struct zfcp_fc_gpn_ft *gpn_ft, | |||
617 | 617 | ||
618 | list_for_each_entry_safe(port, tmp, &remove_lh, list) { | 618 | list_for_each_entry_safe(port, tmp, &remove_lh, list) { |
619 | zfcp_erp_port_shutdown(port, 0, "fcegpf2", NULL); | 619 | zfcp_erp_port_shutdown(port, 0, "fcegpf2", NULL); |
620 | zfcp_device_unregister(&port->sysfs_device, | 620 | zfcp_device_unregister(&port->dev, &zfcp_sysfs_port_attrs); |
621 | &zfcp_sysfs_port_attrs); | ||
622 | } | 621 | } |
623 | 622 | ||
624 | return ret; | 623 | return ret; |
@@ -732,7 +731,7 @@ static int zfcp_fc_exec_els_job(struct fc_bsg_job *job, | |||
732 | return -EINVAL; | 731 | return -EINVAL; |
733 | 732 | ||
734 | d_id = port->d_id; | 733 | d_id = port->d_id; |
735 | put_device(&port->sysfs_device); | 734 | put_device(&port->dev); |
736 | } else | 735 | } else |
737 | d_id = ntoh24(job->request->rqst_data.h_els.port_id); | 736 | d_id = ntoh24(job->request->rqst_data.h_els.port_id); |
738 | 737 | ||
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 69393b8c50d7..bd4d71cdcace 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Implementation of FSF commands. | 4 | * Implementation of FSF commands. |
5 | * | 5 | * |
6 | * Copyright IBM Corporation 2002, 2009 | 6 | * Copyright IBM Corporation 2002, 2010 |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #define KMSG_COMPONENT "zfcp" | 9 | #define KMSG_COMPONENT "zfcp" |
@@ -1471,7 +1471,7 @@ static void zfcp_fsf_open_port_handler(struct zfcp_fsf_req *req) | |||
1471 | } | 1471 | } |
1472 | 1472 | ||
1473 | out: | 1473 | out: |
1474 | put_device(&port->sysfs_device); | 1474 | put_device(&port->dev); |
1475 | } | 1475 | } |
1476 | 1476 | ||
1477 | /** | 1477 | /** |
@@ -1509,14 +1509,14 @@ int zfcp_fsf_open_port(struct zfcp_erp_action *erp_action) | |||
1509 | req->data = port; | 1509 | req->data = port; |
1510 | req->erp_action = erp_action; | 1510 | req->erp_action = erp_action; |
1511 | erp_action->fsf_req_id = req->req_id; | 1511 | erp_action->fsf_req_id = req->req_id; |
1512 | get_device(&port->sysfs_device); | 1512 | get_device(&port->dev); |
1513 | 1513 | ||
1514 | zfcp_fsf_start_erp_timer(req); | 1514 | zfcp_fsf_start_erp_timer(req); |
1515 | retval = zfcp_fsf_req_send(req); | 1515 | retval = zfcp_fsf_req_send(req); |
1516 | if (retval) { | 1516 | if (retval) { |
1517 | zfcp_fsf_req_free(req); | 1517 | zfcp_fsf_req_free(req); |
1518 | erp_action->fsf_req_id = 0; | 1518 | erp_action->fsf_req_id = 0; |
1519 | put_device(&port->sysfs_device); | 1519 | put_device(&port->dev); |
1520 | } | 1520 | } |
1521 | out: | 1521 | out: |
1522 | spin_unlock_bh(&qdio->req_q_lock); | 1522 | spin_unlock_bh(&qdio->req_q_lock); |
@@ -2261,7 +2261,7 @@ skip_fsfstatus: | |||
2261 | else { | 2261 | else { |
2262 | zfcp_fsf_send_fcp_command_task_handler(req); | 2262 | zfcp_fsf_send_fcp_command_task_handler(req); |
2263 | req->unit = NULL; | 2263 | req->unit = NULL; |
2264 | put_device(&unit->sysfs_device); | 2264 | put_device(&unit->dev); |
2265 | } | 2265 | } |
2266 | } | 2266 | } |
2267 | 2267 | ||
@@ -2299,7 +2299,7 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit, | |||
2299 | } | 2299 | } |
2300 | 2300 | ||
2301 | req->status |= ZFCP_STATUS_FSFREQ_CLEANUP; | 2301 | req->status |= ZFCP_STATUS_FSFREQ_CLEANUP; |
2302 | get_device(&unit->sysfs_device); | 2302 | get_device(&unit->dev); |
2303 | req->unit = unit; | 2303 | req->unit = unit; |
2304 | req->data = scsi_cmnd; | 2304 | req->data = scsi_cmnd; |
2305 | req->handler = zfcp_fsf_send_fcp_command_handler; | 2305 | req->handler = zfcp_fsf_send_fcp_command_handler; |
@@ -2356,7 +2356,7 @@ int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit, | |||
2356 | goto out; | 2356 | goto out; |
2357 | 2357 | ||
2358 | failed_scsi_cmnd: | 2358 | failed_scsi_cmnd: |
2359 | put_device(&unit->sysfs_device); | 2359 | put_device(&unit->dev); |
2360 | zfcp_fsf_req_free(req); | 2360 | zfcp_fsf_req_free(req); |
2361 | scsi_cmnd->host_scribble = NULL; | 2361 | scsi_cmnd->host_scribble = NULL; |
2362 | out: | 2362 | out: |
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index 1fce8a49fc60..0d580b2fc4da 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Interface to Linux SCSI midlayer. | 4 | * Interface to Linux SCSI midlayer. |
5 | * | 5 | * |
6 | * Copyright IBM Corporation 2002, 2009 | 6 | * Copyright IBM Corporation 2002, 2010 |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #define KMSG_COMPONENT "zfcp" | 9 | #define KMSG_COMPONENT "zfcp" |
@@ -44,7 +44,7 @@ static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt) | |||
44 | { | 44 | { |
45 | struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata; | 45 | struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata; |
46 | unit->device = NULL; | 46 | unit->device = NULL; |
47 | put_device(&unit->sysfs_device); | 47 | put_device(&unit->dev); |
48 | } | 48 | } |
49 | 49 | ||
50 | static int zfcp_scsi_slave_configure(struct scsi_device *sdp) | 50 | static int zfcp_scsi_slave_configure(struct scsi_device *sdp) |
@@ -511,7 +511,7 @@ static void zfcp_scsi_terminate_rport_io(struct fc_rport *rport) | |||
511 | 511 | ||
512 | if (port) { | 512 | if (port) { |
513 | zfcp_erp_port_reopen(port, 0, "sctrpi1", NULL); | 513 | zfcp_erp_port_reopen(port, 0, "sctrpi1", NULL); |
514 | put_device(&port->sysfs_device); | 514 | put_device(&port->dev); |
515 | } | 515 | } |
516 | } | 516 | } |
517 | 517 | ||
@@ -553,23 +553,23 @@ static void zfcp_scsi_rport_block(struct zfcp_port *port) | |||
553 | 553 | ||
554 | void zfcp_scsi_schedule_rport_register(struct zfcp_port *port) | 554 | void zfcp_scsi_schedule_rport_register(struct zfcp_port *port) |
555 | { | 555 | { |
556 | get_device(&port->sysfs_device); | 556 | get_device(&port->dev); |
557 | port->rport_task = RPORT_ADD; | 557 | port->rport_task = RPORT_ADD; |
558 | 558 | ||
559 | if (!queue_work(port->adapter->work_queue, &port->rport_work)) | 559 | if (!queue_work(port->adapter->work_queue, &port->rport_work)) |
560 | put_device(&port->sysfs_device); | 560 | put_device(&port->dev); |
561 | } | 561 | } |
562 | 562 | ||
563 | void zfcp_scsi_schedule_rport_block(struct zfcp_port *port) | 563 | void zfcp_scsi_schedule_rport_block(struct zfcp_port *port) |
564 | { | 564 | { |
565 | get_device(&port->sysfs_device); | 565 | get_device(&port->dev); |
566 | port->rport_task = RPORT_DEL; | 566 | port->rport_task = RPORT_DEL; |
567 | 567 | ||
568 | if (port->rport && queue_work(port->adapter->work_queue, | 568 | if (port->rport && queue_work(port->adapter->work_queue, |
569 | &port->rport_work)) | 569 | &port->rport_work)) |
570 | return; | 570 | return; |
571 | 571 | ||
572 | put_device(&port->sysfs_device); | 572 | put_device(&port->dev); |
573 | } | 573 | } |
574 | 574 | ||
575 | void zfcp_scsi_schedule_rports_block(struct zfcp_adapter *adapter) | 575 | void zfcp_scsi_schedule_rports_block(struct zfcp_adapter *adapter) |
@@ -598,7 +598,7 @@ void zfcp_scsi_rport_work(struct work_struct *work) | |||
598 | } | 598 | } |
599 | } | 599 | } |
600 | 600 | ||
601 | put_device(&port->sysfs_device); | 601 | put_device(&port->dev); |
602 | } | 602 | } |
603 | 603 | ||
604 | 604 | ||
@@ -616,7 +616,7 @@ void zfcp_scsi_scan(struct work_struct *work) | |||
616 | scsilun_to_int((struct scsi_lun *) | 616 | scsilun_to_int((struct scsi_lun *) |
617 | &unit->fcp_lun), 0); | 617 | &unit->fcp_lun), 0); |
618 | 618 | ||
619 | put_device(&unit->sysfs_device); | 619 | put_device(&unit->dev); |
620 | } | 620 | } |
621 | 621 | ||
622 | struct fc_function_template zfcp_transport_functions = { | 622 | struct fc_function_template zfcp_transport_functions = { |
diff --git a/drivers/s390/scsi/zfcp_sysfs.c b/drivers/s390/scsi/zfcp_sysfs.c index f539e006683c..a43035d4bd70 100644 --- a/drivers/s390/scsi/zfcp_sysfs.c +++ b/drivers/s390/scsi/zfcp_sysfs.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * sysfs attributes. | 4 | * sysfs attributes. |
5 | * | 5 | * |
6 | * Copyright IBM Corporation 2008, 2009 | 6 | * Copyright IBM Corporation 2008, 2010 |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #define KMSG_COMPONENT "zfcp" | 9 | #define KMSG_COMPONENT "zfcp" |
@@ -19,8 +19,7 @@ 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 = container_of(dev, struct _feat_def, \ | 22 | struct _feat_def *_feat = container_of(dev, struct _feat_def, dev); \ |
23 | sysfs_device); \ | ||
24 | \ | 23 | \ |
25 | return sprintf(buf, _format, _value); \ | 24 | return sprintf(buf, _format, _value); \ |
26 | } \ | 25 | } \ |
@@ -87,8 +86,7 @@ static ssize_t zfcp_sysfs_##_feat##_failed_show(struct device *dev, \ | |||
87 | struct device_attribute *attr, \ | 86 | struct device_attribute *attr, \ |
88 | char *buf) \ | 87 | char *buf) \ |
89 | { \ | 88 | { \ |
90 | struct _feat_def *_feat = container_of(dev, struct _feat_def, \ | 89 | struct _feat_def *_feat = container_of(dev, struct _feat_def, dev); \ |
91 | sysfs_device); \ | ||
92 | \ | 90 | \ |
93 | if (atomic_read(&_feat->status) & ZFCP_STATUS_COMMON_ERP_FAILED) \ | 91 | if (atomic_read(&_feat->status) & ZFCP_STATUS_COMMON_ERP_FAILED) \ |
94 | return sprintf(buf, "1\n"); \ | 92 | return sprintf(buf, "1\n"); \ |
@@ -99,12 +97,11 @@ static ssize_t zfcp_sysfs_##_feat##_failed_store(struct device *dev, \ | |||
99 | struct device_attribute *attr,\ | 97 | struct device_attribute *attr,\ |
100 | const char *buf, size_t count)\ | 98 | const char *buf, size_t count)\ |
101 | { \ | 99 | { \ |
102 | struct _feat_def *_feat = container_of(dev, struct _feat_def, \ | 100 | struct _feat_def *_feat = container_of(dev, struct _feat_def, dev); \ |
103 | sysfs_device); \ | ||
104 | unsigned long val; \ | 101 | unsigned long val; \ |
105 | int retval = 0; \ | 102 | int retval = 0; \ |
106 | \ | 103 | \ |
107 | if (!(_feat && get_device(&_feat->sysfs_device))) \ | 104 | if (!(_feat && get_device(&_feat->dev))) \ |
108 | return -EBUSY; \ | 105 | return -EBUSY; \ |
109 | \ | 106 | \ |
110 | if (strict_strtoul(buf, 0, &val) || val != 0) { \ | 107 | if (strict_strtoul(buf, 0, &val) || val != 0) { \ |
@@ -118,7 +115,7 @@ static ssize_t zfcp_sysfs_##_feat##_failed_store(struct device *dev, \ | |||
118 | _reopen_id, NULL); \ | 115 | _reopen_id, NULL); \ |
119 | zfcp_erp_wait(_adapter); \ | 116 | zfcp_erp_wait(_adapter); \ |
120 | out: \ | 117 | out: \ |
121 | put_device(&_feat->sysfs_device); \ | 118 | put_device(&_feat->dev); \ |
122 | return retval ? retval : (ssize_t) count; \ | 119 | return retval ? retval : (ssize_t) count; \ |
123 | } \ | 120 | } \ |
124 | static ZFCP_DEV_ATTR(_feat, failed, S_IWUSR | S_IRUGO, \ | 121 | static ZFCP_DEV_ATTR(_feat, failed, S_IWUSR | S_IRUGO, \ |
@@ -224,10 +221,10 @@ static ssize_t zfcp_sysfs_port_remove_store(struct device *dev, | |||
224 | list_del(&port->list); | 221 | list_del(&port->list); |
225 | write_unlock_irq(&adapter->port_list_lock); | 222 | write_unlock_irq(&adapter->port_list_lock); |
226 | 223 | ||
227 | put_device(&port->sysfs_device); | 224 | put_device(&port->dev); |
228 | 225 | ||
229 | zfcp_erp_port_shutdown(port, 0, "syprs_1", NULL); | 226 | zfcp_erp_port_shutdown(port, 0, "syprs_1", NULL); |
230 | zfcp_device_unregister(&port->sysfs_device, &zfcp_sysfs_port_attrs); | 227 | zfcp_device_unregister(&port->dev, &zfcp_sysfs_port_attrs); |
231 | out: | 228 | out: |
232 | zfcp_ccw_adapter_put(adapter); | 229 | zfcp_ccw_adapter_put(adapter); |
233 | return retval ? retval : (ssize_t) count; | 230 | return retval ? retval : (ssize_t) count; |
@@ -258,13 +255,12 @@ static ssize_t zfcp_sysfs_unit_add_store(struct device *dev, | |||
258 | struct device_attribute *attr, | 255 | struct device_attribute *attr, |
259 | const char *buf, size_t count) | 256 | const char *buf, size_t count) |
260 | { | 257 | { |
261 | struct zfcp_port *port = container_of(dev, struct zfcp_port, | 258 | struct zfcp_port *port = container_of(dev, struct zfcp_port, dev); |
262 | sysfs_device); | ||
263 | struct zfcp_unit *unit; | 259 | struct zfcp_unit *unit; |
264 | u64 fcp_lun; | 260 | u64 fcp_lun; |
265 | int retval = -EINVAL; | 261 | int retval = -EINVAL; |
266 | 262 | ||
267 | if (!(port && get_device(&port->sysfs_device))) | 263 | if (!(port && get_device(&port->dev))) |
268 | return -EBUSY; | 264 | return -EBUSY; |
269 | 265 | ||
270 | if (strict_strtoull(buf, 0, (unsigned long long *) &fcp_lun)) | 266 | if (strict_strtoull(buf, 0, (unsigned long long *) &fcp_lun)) |
@@ -280,7 +276,7 @@ static ssize_t zfcp_sysfs_unit_add_store(struct device *dev, | |||
280 | zfcp_erp_wait(unit->port->adapter); | 276 | zfcp_erp_wait(unit->port->adapter); |
281 | flush_work(&unit->scsi_work); | 277 | flush_work(&unit->scsi_work); |
282 | out: | 278 | out: |
283 | put_device(&port->sysfs_device); | 279 | put_device(&port->dev); |
284 | return retval ? retval : (ssize_t) count; | 280 | return retval ? retval : (ssize_t) count; |
285 | } | 281 | } |
286 | static DEVICE_ATTR(unit_add, S_IWUSR, NULL, zfcp_sysfs_unit_add_store); | 282 | static DEVICE_ATTR(unit_add, S_IWUSR, NULL, zfcp_sysfs_unit_add_store); |
@@ -289,13 +285,12 @@ static ssize_t zfcp_sysfs_unit_remove_store(struct device *dev, | |||
289 | struct device_attribute *attr, | 285 | struct device_attribute *attr, |
290 | const char *buf, size_t count) | 286 | const char *buf, size_t count) |
291 | { | 287 | { |
292 | struct zfcp_port *port = container_of(dev, struct zfcp_port, | 288 | struct zfcp_port *port = container_of(dev, struct zfcp_port, dev); |
293 | sysfs_device); | ||
294 | struct zfcp_unit *unit; | 289 | struct zfcp_unit *unit; |
295 | u64 fcp_lun; | 290 | u64 fcp_lun; |
296 | int retval = -EINVAL; | 291 | int retval = -EINVAL; |
297 | 292 | ||
298 | if (!(port && get_device(&port->sysfs_device))) | 293 | if (!(port && get_device(&port->dev))) |
299 | return -EBUSY; | 294 | return -EBUSY; |
300 | 295 | ||
301 | if (strict_strtoull(buf, 0, (unsigned long long *) &fcp_lun)) | 296 | if (strict_strtoull(buf, 0, (unsigned long long *) &fcp_lun)) |
@@ -314,12 +309,12 @@ static ssize_t zfcp_sysfs_unit_remove_store(struct device *dev, | |||
314 | list_del(&unit->list); | 309 | list_del(&unit->list); |
315 | write_unlock_irq(&port->unit_list_lock); | 310 | write_unlock_irq(&port->unit_list_lock); |
316 | 311 | ||
317 | put_device(&unit->sysfs_device); | 312 | put_device(&unit->dev); |
318 | 313 | ||
319 | zfcp_erp_unit_shutdown(unit, 0, "syurs_1", NULL); | 314 | zfcp_erp_unit_shutdown(unit, 0, "syurs_1", NULL); |
320 | zfcp_device_unregister(&unit->sysfs_device, &zfcp_sysfs_unit_attrs); | 315 | zfcp_device_unregister(&unit->dev, &zfcp_sysfs_unit_attrs); |
321 | out: | 316 | out: |
322 | put_device(&port->sysfs_device); | 317 | put_device(&port->dev); |
323 | return retval ? retval : (ssize_t) count; | 318 | return retval ? retval : (ssize_t) count; |
324 | } | 319 | } |
325 | static DEVICE_ATTR(unit_remove, S_IWUSR, NULL, zfcp_sysfs_unit_remove_store); | 320 | static DEVICE_ATTR(unit_remove, S_IWUSR, NULL, zfcp_sysfs_unit_remove_store); |