diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index f8594a2..e6d8ea8 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -520,209 +520,6 @@
 	.disable_target_scan = 1,
 };
 
-#define ZFCP_DEFINE_LATENCY_ATTR(_name) 				\
-static ssize_t								\
-zfcp_sysfs_unit_##_name##_latency_show(struct device *dev,		\
-				       struct device_attribute *attr,	\
-				       char *buf) {			\
-	struct scsi_device *sdev = to_scsi_device(dev);			\
-	struct zfcp_unit *unit = sdev->hostdata;			\
-	struct zfcp_latencies *lat = &unit->latencies;			\
-	struct zfcp_adapter *adapter = unit->port->adapter;		\
-	unsigned long flags;						\
-	unsigned long long fsum, fmin, fmax, csum, cmin, cmax, cc;	\
-									\
-	spin_lock_irqsave(&lat->lock, flags);				\
-	fsum = lat->_name.fabric.sum * adapter->timer_ticks;		\
-	fmin = lat->_name.fabric.min * adapter->timer_ticks;		\
-	fmax = lat->_name.fabric.max * adapter->timer_ticks;		\
-	csum = lat->_name.channel.sum * adapter->timer_ticks;		\
-	cmin = lat->_name.channel.min * adapter->timer_ticks;		\
-	cmax = lat->_name.channel.max * adapter->timer_ticks;		\
-	cc  = lat->_name.counter;					\
-	spin_unlock_irqrestore(&lat->lock, flags);			\
-									\
-	do_div(fsum, 1000);						\
-	do_div(fmin, 1000);						\
-	do_div(fmax, 1000);						\
-	do_div(csum, 1000);						\
-	do_div(cmin, 1000);						\
-	do_div(cmax, 1000);						\
-									\
-	return sprintf(buf, "%llu %llu %llu %llu %llu %llu %llu\n",	\
-		       fmin, fmax, fsum, cmin, cmax, csum, cc); 	\
-}									\
-static ssize_t								\
-zfcp_sysfs_unit_##_name##_latency_store(struct device *dev,		\
-					struct device_attribute *attr,	\
-					const char *buf, size_t count)	\
-{									\
-	struct scsi_device *sdev = to_scsi_device(dev);			\
-	struct zfcp_unit *unit = sdev->hostdata;			\
-	struct zfcp_latencies *lat = &unit->latencies;			\
-	unsigned long flags;						\
-									\
-	spin_lock_irqsave(&lat->lock, flags);				\
-	lat->_name.fabric.sum = 0;					\
-	lat->_name.fabric.min = 0xFFFFFFFF;				\
-	lat->_name.fabric.max = 0;					\
-	lat->_name.channel.sum = 0;					\
-	lat->_name.channel.min = 0xFFFFFFFF;				\
-	lat->_name.channel.max = 0;					\
-	lat->_name.counter = 0;						\
-	spin_unlock_irqrestore(&lat->lock, flags);			\
-									\
-	return (ssize_t) count;						\
-}									\
-static DEVICE_ATTR(_name##_latency, S_IWUSR | S_IRUGO,			\
-		   zfcp_sysfs_unit_##_name##_latency_show,		\
-		   zfcp_sysfs_unit_##_name##_latency_store);
-
-ZFCP_DEFINE_LATENCY_ATTR(read);
-ZFCP_DEFINE_LATENCY_ATTR(write);
-ZFCP_DEFINE_LATENCY_ATTR(cmd);
-
-#define ZFCP_DEFINE_SCSI_ATTR(_name, _format, _value)                    \
-static ssize_t zfcp_sysfs_scsi_##_name##_show(struct device *dev, struct device_attribute *attr,        \
-                                              char *buf)                 \
-{                                                                        \
-        struct scsi_device *sdev;                                        \
-        struct zfcp_unit *unit;                                          \
-                                                                         \
-        sdev = to_scsi_device(dev);                                      \
-        unit = sdev->hostdata;                                           \
-        return sprintf(buf, _format, _value);                            \
-}                                                                        \
-                                                                         \
-static DEVICE_ATTR(_name, S_IRUGO, zfcp_sysfs_scsi_##_name##_show, NULL);
-
-ZFCP_DEFINE_SCSI_ATTR(hba_id, "%s\n",
-	unit->port->adapter->ccw_device->dev.bus_id);
-ZFCP_DEFINE_SCSI_ATTR(wwpn, "0x%016llx\n", unit->port->wwpn);
-ZFCP_DEFINE_SCSI_ATTR(fcp_lun, "0x%016llx\n", unit->fcp_lun);
-
-static struct device_attribute *zfcp_sysfs_sdev_attrs[] = {
-	&dev_attr_fcp_lun,
-	&dev_attr_wwpn,
-	&dev_attr_hba_id,
-	&dev_attr_read_latency,
-	&dev_attr_write_latency,
-	&dev_attr_cmd_latency,
-	NULL
-};
-
-static ssize_t zfcp_sysfs_adapter_util_show(struct device *dev,
-					    struct device_attribute *attr,
-					    char *buf)
-{
-	struct Scsi_Host *scsi_host = dev_to_shost(dev);
-	struct fsf_qtcb_bottom_port *qtcb_port;
-	struct zfcp_adapter *adapter;
-	int retval;
-
-	adapter = (struct zfcp_adapter *) scsi_host->hostdata[0];
-	if (!(adapter->adapter_features & FSF_FEATURE_MEASUREMENT_DATA))
-		return -EOPNOTSUPP;
-
-	qtcb_port = kzalloc(sizeof(struct fsf_qtcb_bottom_port), GFP_KERNEL);
-	if (!qtcb_port)
-		return -ENOMEM;
-
-	retval = zfcp_fsf_exchange_port_data_sync(adapter, qtcb_port);
-	if (!retval)
-		retval = sprintf(buf, "%u %u %u\n", qtcb_port->cp_util,
-				 qtcb_port->cb_util, qtcb_port->a_util);
-	kfree(qtcb_port);
-	return retval;
-}
-
-static int zfcp_sysfs_adapter_ex_config(struct device *dev,
-					struct fsf_statistics_info *stat_inf)
-{
-	struct Scsi_Host *scsi_host = dev_to_shost(dev);
-	struct fsf_qtcb_bottom_config *qtcb_config;
-	struct zfcp_adapter *adapter;
-	int retval;
-
-	adapter = (struct zfcp_adapter *) scsi_host->hostdata[0];
-	if (!(adapter->adapter_features & FSF_FEATURE_MEASUREMENT_DATA))
-		return -EOPNOTSUPP;
-
-	qtcb_config = kzalloc(sizeof(struct fsf_qtcb_bottom_config),
-			      GFP_KERNEL);
-	if (!qtcb_config)
-		return -ENOMEM;
-
-	retval = zfcp_fsf_exchange_config_data_sync(adapter, qtcb_config);
-	if (!retval)
-		*stat_inf = qtcb_config->stat_info;
-
-	kfree(qtcb_config);
-	return retval;
-}
-
-static ssize_t zfcp_sysfs_adapter_request_show(struct device *dev,
-					       struct device_attribute *attr,
-					       char *buf)
-{
-	struct fsf_statistics_info stat_info;
-	int retval;
-
-	retval = zfcp_sysfs_adapter_ex_config(dev, &stat_info);
-	if (retval)
-		return retval;
-
-	return sprintf(buf, "%llu %llu %llu\n",
-		       (unsigned long long) stat_info.input_req,
-		       (unsigned long long) stat_info.output_req,
-		       (unsigned long long) stat_info.control_req);
-}
-
-static ssize_t zfcp_sysfs_adapter_mb_show(struct device *dev,
-					  struct device_attribute *attr,
-					  char *buf)
-{
-	struct fsf_statistics_info stat_info;
-	int retval;
-
-	retval = zfcp_sysfs_adapter_ex_config(dev, &stat_info);
-	if (retval)
-		return retval;
-
-	return sprintf(buf, "%llu %llu\n",
-		       (unsigned long long) stat_info.input_mb,
-		       (unsigned long long) stat_info.output_mb);
-}
-
-static ssize_t zfcp_sysfs_adapter_sec_active_show(struct device *dev,
-						  struct device_attribute *attr,
-						  char *buf)
-{
-	struct fsf_statistics_info stat_info;
-	int retval;
-
-	retval = zfcp_sysfs_adapter_ex_config(dev, &stat_info);
-	if (retval)
-		return retval;
-
-	return sprintf(buf, "%llu\n",
-		       (unsigned long long) stat_info.seconds_act);
-}
-
-static DEVICE_ATTR(utilization, S_IRUGO, zfcp_sysfs_adapter_util_show, NULL);
-static DEVICE_ATTR(requests, S_IRUGO, zfcp_sysfs_adapter_request_show, NULL);
-static DEVICE_ATTR(megabytes, S_IRUGO, zfcp_sysfs_adapter_mb_show, NULL);
-static DEVICE_ATTR(seconds_active, S_IRUGO,
-		   zfcp_sysfs_adapter_sec_active_show, NULL);
-
-static struct device_attribute *zfcp_a_stats_attrs[] = {
-	&dev_attr_utilization,
-	&dev_attr_requests,
-	&dev_attr_megabytes,
-	&dev_attr_seconds_active,
-	NULL
-};
-
 struct zfcp_data zfcp_data = {
 	.scsi_host_template = {
 		.name			 = "zfcp",
@@ -743,7 +540,6 @@
 		.use_clustering		 = 1,
 		.sdev_attrs		 = zfcp_sysfs_sdev_attrs,
 		.max_sectors		 = (ZFCP_MAX_SBALES_PER_REQ * 8),
-		.shost_attrs		 = zfcp_a_stats_attrs,
+		.shost_attrs		 = zfcp_sysfs_shost_attrs,
 	},
 };
-
