diff options
Diffstat (limited to 'drivers/scsi/ibmvscsi')
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvscsi.c | 44 | ||||
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvstgt.c | 25 |
2 files changed, 39 insertions, 30 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 78d46a900bb5..4a922c57125e 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c | |||
@@ -1456,9 +1456,10 @@ static int ibmvscsi_change_queue_depth(struct scsi_device *sdev, int qdepth) | |||
1456 | /* ------------------------------------------------------------ | 1456 | /* ------------------------------------------------------------ |
1457 | * sysfs attributes | 1457 | * sysfs attributes |
1458 | */ | 1458 | */ |
1459 | static ssize_t show_host_srp_version(struct class_device *class_dev, char *buf) | 1459 | static ssize_t show_host_srp_version(struct device *dev, |
1460 | struct device_attribute *attr, char *buf) | ||
1460 | { | 1461 | { |
1461 | struct Scsi_Host *shost = class_to_shost(class_dev); | 1462 | struct Scsi_Host *shost = class_to_shost(dev); |
1462 | struct ibmvscsi_host_data *hostdata = shost_priv(shost); | 1463 | struct ibmvscsi_host_data *hostdata = shost_priv(shost); |
1463 | int len; | 1464 | int len; |
1464 | 1465 | ||
@@ -1467,7 +1468,7 @@ static ssize_t show_host_srp_version(struct class_device *class_dev, char *buf) | |||
1467 | return len; | 1468 | return len; |
1468 | } | 1469 | } |
1469 | 1470 | ||
1470 | static struct class_device_attribute ibmvscsi_host_srp_version = { | 1471 | static struct device_attribute ibmvscsi_host_srp_version = { |
1471 | .attr = { | 1472 | .attr = { |
1472 | .name = "srp_version", | 1473 | .name = "srp_version", |
1473 | .mode = S_IRUGO, | 1474 | .mode = S_IRUGO, |
@@ -1475,10 +1476,11 @@ static struct class_device_attribute ibmvscsi_host_srp_version = { | |||
1475 | .show = show_host_srp_version, | 1476 | .show = show_host_srp_version, |
1476 | }; | 1477 | }; |
1477 | 1478 | ||
1478 | static ssize_t show_host_partition_name(struct class_device *class_dev, | 1479 | static ssize_t show_host_partition_name(struct device *dev, |
1480 | struct device_attribute *attr, | ||
1479 | char *buf) | 1481 | char *buf) |
1480 | { | 1482 | { |
1481 | struct Scsi_Host *shost = class_to_shost(class_dev); | 1483 | struct Scsi_Host *shost = class_to_shost(dev); |
1482 | struct ibmvscsi_host_data *hostdata = shost_priv(shost); | 1484 | struct ibmvscsi_host_data *hostdata = shost_priv(shost); |
1483 | int len; | 1485 | int len; |
1484 | 1486 | ||
@@ -1487,7 +1489,7 @@ static ssize_t show_host_partition_name(struct class_device *class_dev, | |||
1487 | return len; | 1489 | return len; |
1488 | } | 1490 | } |
1489 | 1491 | ||
1490 | static struct class_device_attribute ibmvscsi_host_partition_name = { | 1492 | static struct device_attribute ibmvscsi_host_partition_name = { |
1491 | .attr = { | 1493 | .attr = { |
1492 | .name = "partition_name", | 1494 | .name = "partition_name", |
1493 | .mode = S_IRUGO, | 1495 | .mode = S_IRUGO, |
@@ -1495,10 +1497,11 @@ static struct class_device_attribute ibmvscsi_host_partition_name = { | |||
1495 | .show = show_host_partition_name, | 1497 | .show = show_host_partition_name, |
1496 | }; | 1498 | }; |
1497 | 1499 | ||
1498 | static ssize_t show_host_partition_number(struct class_device *class_dev, | 1500 | static ssize_t show_host_partition_number(struct device *dev, |
1501 | struct device_attribute *attr, | ||
1499 | char *buf) | 1502 | char *buf) |
1500 | { | 1503 | { |
1501 | struct Scsi_Host *shost = class_to_shost(class_dev); | 1504 | struct Scsi_Host *shost = class_to_shost(dev); |
1502 | struct ibmvscsi_host_data *hostdata = shost_priv(shost); | 1505 | struct ibmvscsi_host_data *hostdata = shost_priv(shost); |
1503 | int len; | 1506 | int len; |
1504 | 1507 | ||
@@ -1507,7 +1510,7 @@ static ssize_t show_host_partition_number(struct class_device *class_dev, | |||
1507 | return len; | 1510 | return len; |
1508 | } | 1511 | } |
1509 | 1512 | ||
1510 | static struct class_device_attribute ibmvscsi_host_partition_number = { | 1513 | static struct device_attribute ibmvscsi_host_partition_number = { |
1511 | .attr = { | 1514 | .attr = { |
1512 | .name = "partition_number", | 1515 | .name = "partition_number", |
1513 | .mode = S_IRUGO, | 1516 | .mode = S_IRUGO, |
@@ -1515,9 +1518,10 @@ static struct class_device_attribute ibmvscsi_host_partition_number = { | |||
1515 | .show = show_host_partition_number, | 1518 | .show = show_host_partition_number, |
1516 | }; | 1519 | }; |
1517 | 1520 | ||
1518 | static ssize_t show_host_mad_version(struct class_device *class_dev, char *buf) | 1521 | static ssize_t show_host_mad_version(struct device *dev, |
1522 | struct device_attribute *attr, char *buf) | ||
1519 | { | 1523 | { |
1520 | struct Scsi_Host *shost = class_to_shost(class_dev); | 1524 | struct Scsi_Host *shost = class_to_shost(dev); |
1521 | struct ibmvscsi_host_data *hostdata = shost_priv(shost); | 1525 | struct ibmvscsi_host_data *hostdata = shost_priv(shost); |
1522 | int len; | 1526 | int len; |
1523 | 1527 | ||
@@ -1526,7 +1530,7 @@ static ssize_t show_host_mad_version(struct class_device *class_dev, char *buf) | |||
1526 | return len; | 1530 | return len; |
1527 | } | 1531 | } |
1528 | 1532 | ||
1529 | static struct class_device_attribute ibmvscsi_host_mad_version = { | 1533 | static struct device_attribute ibmvscsi_host_mad_version = { |
1530 | .attr = { | 1534 | .attr = { |
1531 | .name = "mad_version", | 1535 | .name = "mad_version", |
1532 | .mode = S_IRUGO, | 1536 | .mode = S_IRUGO, |
@@ -1534,9 +1538,10 @@ static struct class_device_attribute ibmvscsi_host_mad_version = { | |||
1534 | .show = show_host_mad_version, | 1538 | .show = show_host_mad_version, |
1535 | }; | 1539 | }; |
1536 | 1540 | ||
1537 | static ssize_t show_host_os_type(struct class_device *class_dev, char *buf) | 1541 | static ssize_t show_host_os_type(struct device *dev, |
1542 | struct device_attribute *attr, char *buf) | ||
1538 | { | 1543 | { |
1539 | struct Scsi_Host *shost = class_to_shost(class_dev); | 1544 | struct Scsi_Host *shost = class_to_shost(dev); |
1540 | struct ibmvscsi_host_data *hostdata = shost_priv(shost); | 1545 | struct ibmvscsi_host_data *hostdata = shost_priv(shost); |
1541 | int len; | 1546 | int len; |
1542 | 1547 | ||
@@ -1544,7 +1549,7 @@ static ssize_t show_host_os_type(struct class_device *class_dev, char *buf) | |||
1544 | return len; | 1549 | return len; |
1545 | } | 1550 | } |
1546 | 1551 | ||
1547 | static struct class_device_attribute ibmvscsi_host_os_type = { | 1552 | static struct device_attribute ibmvscsi_host_os_type = { |
1548 | .attr = { | 1553 | .attr = { |
1549 | .name = "os_type", | 1554 | .name = "os_type", |
1550 | .mode = S_IRUGO, | 1555 | .mode = S_IRUGO, |
@@ -1552,9 +1557,10 @@ static struct class_device_attribute ibmvscsi_host_os_type = { | |||
1552 | .show = show_host_os_type, | 1557 | .show = show_host_os_type, |
1553 | }; | 1558 | }; |
1554 | 1559 | ||
1555 | static ssize_t show_host_config(struct class_device *class_dev, char *buf) | 1560 | static ssize_t show_host_config(struct device *dev, |
1561 | struct device_attribute *attr, char *buf) | ||
1556 | { | 1562 | { |
1557 | struct Scsi_Host *shost = class_to_shost(class_dev); | 1563 | struct Scsi_Host *shost = class_to_shost(dev); |
1558 | struct ibmvscsi_host_data *hostdata = shost_priv(shost); | 1564 | struct ibmvscsi_host_data *hostdata = shost_priv(shost); |
1559 | 1565 | ||
1560 | /* returns null-terminated host config data */ | 1566 | /* returns null-terminated host config data */ |
@@ -1564,7 +1570,7 @@ static ssize_t show_host_config(struct class_device *class_dev, char *buf) | |||
1564 | return 0; | 1570 | return 0; |
1565 | } | 1571 | } |
1566 | 1572 | ||
1567 | static struct class_device_attribute ibmvscsi_host_config = { | 1573 | static struct device_attribute ibmvscsi_host_config = { |
1568 | .attr = { | 1574 | .attr = { |
1569 | .name = "config", | 1575 | .name = "config", |
1570 | .mode = S_IRUGO, | 1576 | .mode = S_IRUGO, |
@@ -1572,7 +1578,7 @@ static struct class_device_attribute ibmvscsi_host_config = { | |||
1572 | .show = show_host_config, | 1578 | .show = show_host_config, |
1573 | }; | 1579 | }; |
1574 | 1580 | ||
1575 | static struct class_device_attribute *ibmvscsi_attrs[] = { | 1581 | static struct device_attribute *ibmvscsi_attrs[] = { |
1576 | &ibmvscsi_host_srp_version, | 1582 | &ibmvscsi_host_srp_version, |
1577 | &ibmvscsi_host_partition_name, | 1583 | &ibmvscsi_host_partition_name, |
1578 | &ibmvscsi_host_partition_number, | 1584 | &ibmvscsi_host_partition_number, |
diff --git a/drivers/scsi/ibmvscsi/ibmvstgt.c b/drivers/scsi/ibmvscsi/ibmvstgt.c index e5881e92d0fb..3b9514c8f1f1 100644 --- a/drivers/scsi/ibmvscsi/ibmvstgt.c +++ b/drivers/scsi/ibmvscsi/ibmvstgt.c | |||
@@ -780,32 +780,35 @@ static int ibmvstgt_it_nexus_response(struct Scsi_Host *shost, u64 itn_id, | |||
780 | return 0; | 780 | return 0; |
781 | } | 781 | } |
782 | 782 | ||
783 | static ssize_t system_id_show(struct class_device *cdev, char *buf) | 783 | static ssize_t system_id_show(struct device *dev, |
784 | struct device_attribute *attr, char *buf) | ||
784 | { | 785 | { |
785 | return snprintf(buf, PAGE_SIZE, "%s\n", system_id); | 786 | return snprintf(buf, PAGE_SIZE, "%s\n", system_id); |
786 | } | 787 | } |
787 | 788 | ||
788 | static ssize_t partition_number_show(struct class_device *cdev, char *buf) | 789 | static ssize_t partition_number_show(struct device *dev, |
790 | struct device_attribute *attr, char *buf) | ||
789 | { | 791 | { |
790 | return snprintf(buf, PAGE_SIZE, "%x\n", partition_number); | 792 | return snprintf(buf, PAGE_SIZE, "%x\n", partition_number); |
791 | } | 793 | } |
792 | 794 | ||
793 | static ssize_t unit_address_show(struct class_device *cdev, char *buf) | 795 | static ssize_t unit_address_show(struct device *dev, |
796 | struct device_attribute *attr, char *buf) | ||
794 | { | 797 | { |
795 | struct Scsi_Host *shost = class_to_shost(cdev); | 798 | struct Scsi_Host *shost = class_to_shost(dev); |
796 | struct srp_target *target = host_to_srp_target(shost); | 799 | struct srp_target *target = host_to_srp_target(shost); |
797 | struct vio_port *vport = target_to_port(target); | 800 | struct vio_port *vport = target_to_port(target); |
798 | return snprintf(buf, PAGE_SIZE, "%x\n", vport->dma_dev->unit_address); | 801 | return snprintf(buf, PAGE_SIZE, "%x\n", vport->dma_dev->unit_address); |
799 | } | 802 | } |
800 | 803 | ||
801 | static CLASS_DEVICE_ATTR(system_id, S_IRUGO, system_id_show, NULL); | 804 | static DEVICE_ATTR(system_id, S_IRUGO, system_id_show, NULL); |
802 | static CLASS_DEVICE_ATTR(partition_number, S_IRUGO, partition_number_show, NULL); | 805 | static DEVICE_ATTR(partition_number, S_IRUGO, partition_number_show, NULL); |
803 | static CLASS_DEVICE_ATTR(unit_address, S_IRUGO, unit_address_show, NULL); | 806 | static DEVICE_ATTR(unit_address, S_IRUGO, unit_address_show, NULL); |
804 | 807 | ||
805 | static struct class_device_attribute *ibmvstgt_attrs[] = { | 808 | static struct device_attribute *ibmvstgt_attrs[] = { |
806 | &class_device_attr_system_id, | 809 | &dev_attr_system_id, |
807 | &class_device_attr_partition_number, | 810 | &dev_attr_partition_number, |
808 | &class_device_attr_unit_address, | 811 | &dev_attr_unit_address, |
809 | NULL, | 812 | NULL, |
810 | }; | 813 | }; |
811 | 814 | ||