Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 615f59e0 authored by Christof Schmitt's avatar Christof Schmitt Committed by James Bottomley
Browse files

[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: default avatarSwen Schillig <swen@vnet.ibm.com>
Signed-off-by: default avatarChristof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 5bdecd22
Loading
Loading
Loading
Loading
+25 −29
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 *
 * Module interface and handling of zfcp data structures.
 *
 * Copyright IBM Corporation 2002, 2009
 * Copyright IBM Corporation 2002, 2010
 */

/*
@@ -81,7 +81,7 @@ static void __init zfcp_init_device_configure(char *busid, u64 wwpn, u64 lun)
	flush_work(&unit->scsi_work);

out_unit:
	put_device(&port->sysfs_device);
	put_device(&port->dev);
out_port:
	zfcp_ccw_adapter_put(adapter);
out_ccw_device:
@@ -226,7 +226,7 @@ struct zfcp_unit *zfcp_get_unit_by_lun(struct zfcp_port *port, u64 fcp_lun)
	read_lock_irqsave(&port->unit_list_lock, flags);
	list_for_each_entry(unit, &port->unit_list, list)
		if (unit->fcp_lun == fcp_lun) {
			if (!get_device(&unit->sysfs_device))
			if (!get_device(&unit->dev))
				unit = NULL;
			read_unlock_irqrestore(&port->unit_list_lock, flags);
			return unit;
@@ -251,7 +251,7 @@ struct zfcp_port *zfcp_get_port_by_wwpn(struct zfcp_adapter *adapter,
	read_lock_irqsave(&adapter->port_list_lock, flags);
	list_for_each_entry(port, &adapter->port_list, list)
		if (port->wwpn == wwpn) {
			if (!get_device(&port->sysfs_device))
			if (!get_device(&port->dev))
				port = NULL;
			read_unlock_irqrestore(&adapter->port_list_lock, flags);
			return port;
@@ -269,10 +269,9 @@ struct zfcp_port *zfcp_get_port_by_wwpn(struct zfcp_adapter *adapter,
 */
static void zfcp_unit_release(struct device *dev)
{
	struct zfcp_unit *unit = container_of(dev, struct zfcp_unit,
					      sysfs_device);
	struct zfcp_unit *unit = container_of(dev, struct zfcp_unit, dev);

	put_device(&unit->port->sysfs_device);
	put_device(&unit->port->dev);
	kfree(unit);
}

@@ -289,11 +288,11 @@ struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *port, u64 fcp_lun)
	struct zfcp_unit *unit;
	int retval = -ENOMEM;

	get_device(&port->sysfs_device);
	get_device(&port->dev);

	unit = zfcp_get_unit_by_lun(port, fcp_lun);
	if (unit) {
		put_device(&unit->sysfs_device);
		put_device(&unit->dev);
		retval = -EEXIST;
		goto err_out;
	}
@@ -304,10 +303,10 @@ struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *port, u64 fcp_lun)

	unit->port = port;
	unit->fcp_lun = fcp_lun;
	unit->sysfs_device.parent = &port->sysfs_device;
	unit->sysfs_device.release = zfcp_unit_release;
	unit->dev.parent = &port->dev;
	unit->dev.release = zfcp_unit_release;

	if (dev_set_name(&unit->sysfs_device, "0x%016llx",
	if (dev_set_name(&unit->dev, "0x%016llx",
			 (unsigned long long) fcp_lun)) {
		kfree(unit);
		goto err_out;
@@ -324,13 +323,12 @@ struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *port, u64 fcp_lun)
	unit->latencies.cmd.channel.min = 0xFFFFFFFF;
	unit->latencies.cmd.fabric.min = 0xFFFFFFFF;

	if (device_register(&unit->sysfs_device)) {
		put_device(&unit->sysfs_device);
	if (device_register(&unit->dev)) {
		put_device(&unit->dev);
		goto err_out;
	}

	if (sysfs_create_group(&unit->sysfs_device.kobj,
			       &zfcp_sysfs_unit_attrs))
	if (sysfs_create_group(&unit->dev.kobj, &zfcp_sysfs_unit_attrs))
		goto err_out_put;

	write_lock_irq(&port->unit_list_lock);
@@ -342,9 +340,9 @@ struct zfcp_unit *zfcp_unit_enqueue(struct zfcp_port *port, u64 fcp_lun)
	return unit;

err_out_put:
	device_unregister(&unit->sysfs_device);
	device_unregister(&unit->dev);
err_out:
	put_device(&port->sysfs_device);
	put_device(&port->dev);
	return ERR_PTR(retval);
}

@@ -610,8 +608,7 @@ void zfcp_device_unregister(struct device *dev,

static void zfcp_port_release(struct device *dev)
{
	struct zfcp_port *port = container_of(dev, struct zfcp_port,
					      sysfs_device);
	struct zfcp_port *port = container_of(dev, struct zfcp_port, dev);

	zfcp_ccw_adapter_put(port->adapter);
	kfree(port);
@@ -639,7 +636,7 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn,

	port = zfcp_get_port_by_wwpn(adapter, wwpn);
	if (port) {
		put_device(&port->sysfs_device);
		put_device(&port->dev);
		retval = -EEXIST;
		goto err_out;
	}
@@ -659,22 +656,21 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn,
	port->d_id = d_id;
	port->wwpn = wwpn;
	port->rport_task = RPORT_NONE;
	port->sysfs_device.parent = &adapter->ccw_device->dev;
	port->sysfs_device.release = zfcp_port_release;
	port->dev.parent = &adapter->ccw_device->dev;
	port->dev.release = zfcp_port_release;

	if (dev_set_name(&port->sysfs_device, "0x%016llx",
			 (unsigned long long)wwpn)) {
	if (dev_set_name(&port->dev, "0x%016llx", (unsigned long long)wwpn)) {
		kfree(port);
		goto err_out;
	}
	retval = -EINVAL;

	if (device_register(&port->sysfs_device)) {
		put_device(&port->sysfs_device);
	if (device_register(&port->dev)) {
		put_device(&port->dev);
		goto err_out;
	}

	if (sysfs_create_group(&port->sysfs_device.kobj,
	if (sysfs_create_group(&port->dev.kobj,
			       &zfcp_sysfs_port_attrs))
		goto err_out_put;

@@ -687,7 +683,7 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn,
	return port;

err_out_put:
	device_unregister(&port->sysfs_device);
	device_unregister(&port->dev);
err_out:
	zfcp_ccw_adapter_put(adapter);
	return ERR_PTR(retval);
+3 −5
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 *
 * Registration and callback for the s390 common I/O layer.
 *
 * Copyright IBM Corporation 2002, 2009
 * Copyright IBM Corporation 2002, 2010
 */

#define KMSG_COMPONENT "zfcp"
@@ -123,12 +123,10 @@ static void zfcp_ccw_remove(struct ccw_device *cdev)
	zfcp_ccw_adapter_put(adapter); /* put from zfcp_ccw_adapter_by_cdev */

	list_for_each_entry_safe(unit, u, &unit_remove_lh, list)
		zfcp_device_unregister(&unit->sysfs_device,
				       &zfcp_sysfs_unit_attrs);
		zfcp_device_unregister(&unit->dev, &zfcp_sysfs_unit_attrs);

	list_for_each_entry_safe(port, p, &port_remove_lh, list)
		zfcp_device_unregister(&port->sysfs_device,
				       &zfcp_sysfs_port_attrs);
		zfcp_device_unregister(&port->dev, &zfcp_sysfs_port_attrs);

	zfcp_adapter_unregister(adapter);
}
+3 −3
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 *
 * Global definitions for the zfcp device driver.
 *
 * Copyright IBM Corporation 2002, 2009
 * Copyright IBM Corporation 2002, 2010
 */

#ifndef ZFCP_DEF_H
@@ -237,7 +237,7 @@ struct zfcp_adapter {
};

struct zfcp_port {
	struct device          sysfs_device;   /* sysfs device */
	struct device          dev;
	struct fc_rport        *rport;         /* rport of fc transport class */
	struct list_head       list;	       /* list of remote ports */
	struct zfcp_adapter    *adapter;       /* adapter used to access port */
@@ -259,7 +259,7 @@ struct zfcp_port {
};

struct zfcp_unit {
	struct device          sysfs_device;   /* sysfs device */
	struct device          dev;
	struct list_head       list;	       /* list of logical units */
	struct zfcp_port       *port;	       /* remote port of unit */
	atomic_t	       status;	       /* status of this logical unit */
+7 −7
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 *
 * Error Recovery Procedures (ERP).
 *
 * Copyright IBM Corporation 2002, 2009
 * Copyright IBM Corporation 2002, 2010
 */

#define KMSG_COMPONENT "zfcp"
@@ -175,7 +175,7 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need,

	switch (need) {
	case ZFCP_ERP_ACTION_REOPEN_UNIT:
		if (!get_device(&unit->sysfs_device))
		if (!get_device(&unit->dev))
			return NULL;
		atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &unit->status);
		erp_action = &unit->erp_action;
@@ -185,7 +185,7 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need,

	case ZFCP_ERP_ACTION_REOPEN_PORT:
	case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED:
		if (!get_device(&port->sysfs_device))
		if (!get_device(&port->dev))
			return NULL;
		zfcp_erp_action_dismiss_port(port);
		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)
	switch (act->action) {
	case ZFCP_ERP_ACTION_REOPEN_UNIT:
		if ((result == ZFCP_ERP_SUCCEEDED) && !unit->device) {
			get_device(&unit->sysfs_device);
			get_device(&unit->dev);
			if (scsi_queue_work(unit->port->adapter->scsi_host,
					    &unit->scsi_work) <= 0)
				put_device(&unit->sysfs_device);
				put_device(&unit->dev);
		}
		put_device(&unit->sysfs_device);
		put_device(&unit->dev);
		break;

	case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED:
	case ZFCP_ERP_ACTION_REOPEN_PORT:
		if (result == ZFCP_ERP_SUCCEEDED)
			zfcp_scsi_schedule_rport_register(port);
		put_device(&port->sysfs_device);
		put_device(&port->dev);
		break;

	case ZFCP_ERP_ACTION_REOPEN_ADAPTER:
+11 −12
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 *
 * Fibre Channel related functions for the zfcp device driver.
 *
 * Copyright IBM Corporation 2008, 2009
 * Copyright IBM Corporation 2008, 2010
 */

#define KMSG_COMPONENT "zfcp"
@@ -316,7 +316,7 @@ void zfcp_fc_port_did_lookup(struct work_struct *work)

	zfcp_erp_port_reopen(port, 0, "fcgpn_3", NULL);
out:
	put_device(&port->sysfs_device);
	put_device(&port->dev);
}

/**
@@ -325,9 +325,9 @@ void zfcp_fc_port_did_lookup(struct work_struct *work)
 */
void zfcp_fc_trigger_did_lookup(struct zfcp_port *port)
{
	get_device(&port->sysfs_device);
	get_device(&port->dev);
	if (!queue_work(port->adapter->work_queue, &port->gid_pn_work))
		put_device(&port->sysfs_device);
		put_device(&port->dev);
}

/**
@@ -389,7 +389,7 @@ static void zfcp_fc_adisc_handler(void *data)
	zfcp_scsi_schedule_rport_register(port);
 out:
	atomic_clear_mask(ZFCP_STATUS_PORT_LINK_TEST, &port->status);
	put_device(&port->sysfs_device);
	put_device(&port->dev);
	kmem_cache_free(zfcp_data.adisc_cache, adisc);
}

@@ -436,7 +436,7 @@ void zfcp_fc_link_test_work(struct work_struct *work)
		container_of(work, struct zfcp_port, test_link_work);
	int retval;

	get_device(&port->sysfs_device);
	get_device(&port->dev);
	port->rport_task = RPORT_DEL;
	zfcp_scsi_rport_work(&port->rport_work);

@@ -455,7 +455,7 @@ void zfcp_fc_link_test_work(struct work_struct *work)
	zfcp_erp_port_forced_reopen(port, 0, "fcltwk1", NULL);

out:
	put_device(&port->sysfs_device);
	put_device(&port->dev);
}

/**
@@ -468,9 +468,9 @@ void zfcp_fc_link_test_work(struct work_struct *work)
 */
void zfcp_fc_test_link(struct zfcp_port *port)
{
	get_device(&port->sysfs_device);
	get_device(&port->dev);
	if (!queue_work(port->adapter->work_queue, &port->test_link_work))
		put_device(&port->sysfs_device);
		put_device(&port->dev);
}

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,

	list_for_each_entry_safe(port, tmp, &remove_lh, list) {
		zfcp_erp_port_shutdown(port, 0, "fcegpf2", NULL);
		zfcp_device_unregister(&port->sysfs_device,
				       &zfcp_sysfs_port_attrs);
		zfcp_device_unregister(&port->dev, &zfcp_sysfs_port_attrs);
	}

	return ret;
@@ -732,7 +731,7 @@ static int zfcp_fc_exec_els_job(struct fc_bsg_job *job,
			return -EINVAL;

		d_id = port->d_id;
		put_device(&port->sysfs_device);
		put_device(&port->dev);
	} else
		d_id = ntoh24(job->request->rqst_data.h_els.port_id);

Loading