Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: zfcp: Switch to attribute groups

struct device supports attribute groups directly but does not support
struct device_attribute directly. Hence switch to attribute groups.

Link: https://lore.kernel.org/r/20211012233558.4066756-7-bvanassche@acm.org
Acked-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Bart Van Assche and committed by
Martin K. Petersen
d8d7cf3f 2899836f

+39 -21
+2 -2
drivers/s390/scsi/zfcp_ext.h
··· 184 184 extern const struct attribute_group *zfcp_unit_attr_groups[]; 185 185 extern const struct attribute_group *zfcp_port_attr_groups[]; 186 186 extern struct mutex zfcp_sysfs_port_units_mutex; 187 - extern struct device_attribute *zfcp_sysfs_sdev_attrs[]; 188 - extern struct device_attribute *zfcp_sysfs_shost_attrs[]; 187 + extern const struct attribute_group *zfcp_sysfs_sdev_attr_groups[]; 188 + extern const struct attribute_group *zfcp_sysfs_shost_attr_groups[]; 189 189 bool zfcp_sysfs_port_is_removing(const struct zfcp_port *const port); 190 190 191 191 /* zfcp_unit.c */
+2 -2
drivers/s390/scsi/zfcp_scsi.c
··· 444 444 /* report size limit per scatter-gather segment */ 445 445 .max_segment_size = ZFCP_QDIO_SBALE_LEN, 446 446 .dma_boundary = ZFCP_QDIO_SBALE_LEN - 1, 447 - .shost_attrs = zfcp_sysfs_shost_attrs, 448 - .sdev_attrs = zfcp_sysfs_sdev_attrs, 447 + .shost_groups = zfcp_sysfs_shost_attr_groups, 448 + .sdev_groups = zfcp_sysfs_sdev_attr_groups, 449 449 .track_queue_depth = 1, 450 450 .supported_mode = MODE_INITIATOR, 451 451 };
+35 -17
drivers/s390/scsi/zfcp_sysfs.c
··· 672 672 ZFCP_DEFINE_SCSI_ATTR(zfcp_status, "0x%08x\n", 673 673 atomic_read(&zfcp_sdev->status)); 674 674 675 - struct device_attribute *zfcp_sysfs_sdev_attrs[] = { 676 - &dev_attr_fcp_lun, 677 - &dev_attr_wwpn, 678 - &dev_attr_hba_id, 679 - &dev_attr_read_latency, 680 - &dev_attr_write_latency, 681 - &dev_attr_cmd_latency, 682 - &dev_attr_zfcp_access_denied, 683 - &dev_attr_zfcp_failed, 684 - &dev_attr_zfcp_in_recovery, 685 - &dev_attr_zfcp_status, 675 + struct attribute *zfcp_sdev_attrs[] = { 676 + &dev_attr_fcp_lun.attr, 677 + &dev_attr_wwpn.attr, 678 + &dev_attr_hba_id.attr, 679 + &dev_attr_read_latency.attr, 680 + &dev_attr_write_latency.attr, 681 + &dev_attr_cmd_latency.attr, 682 + &dev_attr_zfcp_access_denied.attr, 683 + &dev_attr_zfcp_failed.attr, 684 + &dev_attr_zfcp_in_recovery.attr, 685 + &dev_attr_zfcp_status.attr, 686 + NULL 687 + }; 688 + 689 + static const struct attribute_group zfcp_sysfs_sdev_attr_group = { 690 + .attrs = zfcp_sdev_attrs 691 + }; 692 + 693 + const struct attribute_group *zfcp_sysfs_sdev_attr_groups[] = { 694 + &zfcp_sysfs_sdev_attr_group, 686 695 NULL 687 696 }; 688 697 ··· 792 783 } 793 784 static DEVICE_ATTR(queue_full, S_IRUGO, zfcp_sysfs_adapter_q_full_show, NULL); 794 785 795 - struct device_attribute *zfcp_sysfs_shost_attrs[] = { 796 - &dev_attr_utilization, 797 - &dev_attr_requests, 798 - &dev_attr_megabytes, 799 - &dev_attr_seconds_active, 800 - &dev_attr_queue_full, 786 + static struct attribute *zfcp_sysfs_shost_attrs[] = { 787 + &dev_attr_utilization.attr, 788 + &dev_attr_requests.attr, 789 + &dev_attr_megabytes.attr, 790 + &dev_attr_seconds_active.attr, 791 + &dev_attr_queue_full.attr, 792 + NULL 793 + }; 794 + 795 + static const struct attribute_group zfcp_sysfs_shost_attr_group = { 796 + .attrs = zfcp_sysfs_shost_attrs 797 + }; 798 + 799 + const struct attribute_group *zfcp_sysfs_shost_attr_groups[] = { 800 + &zfcp_sysfs_shost_attr_group, 801 801 NULL 802 802 }; 803 803