aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_aux.c
diff options
context:
space:
mode:
authorChristof Schmitt <christof.schmitt@de.ibm.com>2010-02-17 05:18:56 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-02-17 18:46:30 -0500
commit615f59e0daaf56e43dcaaf3ea228967d9bc21584 (patch)
tree846366936a5077153b8f07b3125e868d7f6bce4e /drivers/s390/scsi/zfcp_aux.c
parent5bdecd2248d4af6f3b311b4d8ca7f3f5f83a7191 (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>
Diffstat (limited to 'drivers/s390/scsi/zfcp_aux.c')
-rw-r--r--drivers/s390/scsi/zfcp_aux.c54
1 files changed, 25 insertions, 29 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
83out_unit: 83out_unit:
84 put_device(&port->sysfs_device); 84 put_device(&port->dev);
85out_port: 85out_port:
86 zfcp_ccw_adapter_put(adapter); 86 zfcp_ccw_adapter_put(adapter);
87out_ccw_device: 87out_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 */
270static void zfcp_unit_release(struct device *dev) 270static 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
344err_out_put: 342err_out_put:
345 device_unregister(&unit->sysfs_device); 343 device_unregister(&unit->dev);
346err_out: 344err_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
611static void zfcp_port_release(struct device *dev) 609static 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
689err_out_put: 685err_out_put:
690 device_unregister(&port->sysfs_device); 686 device_unregister(&port->dev);
691err_out: 687err_out:
692 zfcp_ccw_adapter_put(adapter); 688 zfcp_ccw_adapter_put(adapter);
693 return ERR_PTR(retval); 689 return ERR_PTR(retval);