From patchwork Fri Oct 8 20:23:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546289 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75D03C433EF for ; Fri, 8 Oct 2021 20:24:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5984961040 for ; Fri, 8 Oct 2021 20:24:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242347AbhJHU0A (ORCPT ); Fri, 8 Oct 2021 16:26:00 -0400 Received: from mail-pj1-f47.google.com ([209.85.216.47]:55181 "EHLO mail-pj1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232047AbhJHUZ5 (ORCPT ); Fri, 8 Oct 2021 16:25:57 -0400 Received: by mail-pj1-f47.google.com with SMTP id np13so8411893pjb.4 for ; Fri, 08 Oct 2021 13:24:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Kt2zmEnNC8kSXDLhEYevleO6rodk/ecgntNNeLHdi2w=; b=avq2djBnT0KREPBhQWDsiWfqTPfYnW0P6SJ26thsITfpodb98YG7qKfttC8vnpyvbx LzaxQWguN6IkPqSJrM92ONtovYnWzCmFDJoKFuBeDEUkYGTBjS29tDIom0UyRjWjNmXV klCV71ATJRpEWCLYcNQ3/aoOFXWVNBXfqTvEzzS3xN5G61d4u3+/Ws0Urp9nxi+uBLhO g4v6HS/7L7shZ1RryCfwgQQQKBJrZ/HvTPYk+V6XiN+Dw9KwNj+KROHis7M7Fgx6D/ez J44VUqmCsKPV9ZCspzY98n7SseWsxgGoRnFzZwyGb4KIEFxBgHP7r9q0/p7A7ccoZsHq UCDw== X-Gm-Message-State: AOAM53207G0RAA2MWGQk6H8FYREqLsTVVCHIDBimaPAkgx6s5+Vsv7ON nWqMwpO23OTmclP4TDpYzu13MKxAeX2hzw== X-Google-Smtp-Source: ABdhPJyUyv/0gr4YJaAgj53f1wzuo9FDwSsJfiaCHGP4CY5ZX9v8/EEHGleeVGqwYHBa1DAR7mjroQ== X-Received: by 2002:a17:903:1ca:b0:13e:f367:9361 with SMTP id e10-20020a17090301ca00b0013ef3679361mr11422358plh.3.1633724641349; Fri, 08 Oct 2021 13:24:01 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:00 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Greg Kroah-Hartman , "James E.J. Bottomley" Subject: [PATCH v3 01/46] scsi: core: Register sysfs attributes earlier Date: Fri, 8 Oct 2021 13:23:08 -0700 Message-Id: <20211008202353.1448570-2-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org A quote from Documentation/driver-api/driver-model/device.rst: "Word of warning: While the kernel allows device_create_file() and device_remove_file() to be called on a device at any time, userspace has strict expectations on when attributes get created. When a new device is registered in the kernel, a uevent is generated to notify userspace (like udev) that a new device is available. If attributes are added after the device is registered, then userspace won't get notified and userspace will not know about the new attributes." Hence register SCSI host sysfs attributes before the SCSI host shost_dev uevent is emitted instead of after that event has been emitted. Cc: Greg Kroah-Hartman Signed-off-by: Bart Van Assche Reviewed-by: Benjamin Block --- drivers/scsi/hosts.c | 23 ++++++++++- drivers/scsi/scsi_priv.h | 4 +- drivers/scsi/scsi_sysfs.c | 81 +++++++++++++++++++------------------- include/scsi/scsi_device.h | 7 ++++ include/scsi/scsi_host.h | 12 ++++++ 5 files changed, 84 insertions(+), 43 deletions(-) diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 3f6f14f0cafb..3443f009a9e8 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c @@ -376,7 +376,7 @@ static struct device_type scsi_host_type = { struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) { struct Scsi_Host *shost; - int index; + int index, i, j = 0; shost = kzalloc(sizeof(struct Scsi_Host) + privsize, GFP_KERNEL); if (!shost) @@ -480,7 +480,26 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) shost->shost_dev.parent = &shost->shost_gendev; shost->shost_dev.class = &shost_class; dev_set_name(&shost->shost_dev, "host%d", shost->host_no); - shost->shost_dev.groups = scsi_sysfs_shost_attr_groups; + shost->shost_dev.groups = shost->shost_dev_attr_groups; + shost->shost_dev_attr_groups[j++] = &scsi_shost_attr_group; + if (sht->shost_attrs) { + shost->lld_attr_group = (struct attribute_group){ + .attrs = scsi_convert_dev_attrs(&shost->shost_gendev, + sht->shost_attrs) + }; + if (shost->lld_attr_group.attrs) + shost->shost_dev_attr_groups[j++] = + &shost->lld_attr_group; + } + if (sht->shost_groups) { + for (i = 0; sht->shost_groups[i] && + j < ARRAY_SIZE(shost->shost_dev_attr_groups); + i++, j++) { + shost->shost_dev_attr_groups[j] = + sht->shost_groups[i]; + } + } + WARN_ON_ONCE(j >= ARRAY_SIZE(shost->shost_dev_attr_groups)); shost->ehandler = kthread_run(scsi_error_handler, shost, "scsi_eh_%d", shost->host_no); diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h index 6d9152031a40..a5a2f18cc734 100644 --- a/drivers/scsi/scsi_priv.h +++ b/drivers/scsi/scsi_priv.h @@ -137,13 +137,15 @@ extern int scsi_sysfs_add_sdev(struct scsi_device *); extern int scsi_sysfs_add_host(struct Scsi_Host *); extern int scsi_sysfs_register(void); extern void scsi_sysfs_unregister(void); +struct attribute **scsi_convert_dev_attrs(struct device *dev, + struct device_attribute **dev_attr); extern void scsi_sysfs_device_initialize(struct scsi_device *); extern int scsi_sysfs_target_initialize(struct scsi_device *); extern struct scsi_transport_template blank_transport_template; extern void __scsi_remove_device(struct scsi_device *); extern struct bus_type scsi_bus_type; -extern const struct attribute_group *scsi_sysfs_shost_attr_groups[]; +extern const struct attribute_group scsi_shost_attr_group; /* scsi_netlink.c */ #ifdef CONFIG_SCSI_NETLINK diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 86793259e541..05b4d69d53d4 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -424,15 +424,10 @@ static struct attribute *scsi_sysfs_shost_attrs[] = { NULL }; -static struct attribute_group scsi_shost_attr_group = { +const struct attribute_group scsi_shost_attr_group = { .attrs = scsi_sysfs_shost_attrs, }; -const struct attribute_group *scsi_sysfs_shost_attr_groups[] = { - &scsi_shost_attr_group, - NULL -}; - static void scsi_device_cls_release(struct device *class_dev) { struct scsi_device *sdev; @@ -1333,7 +1328,7 @@ static int scsi_target_add(struct scsi_target *starget) **/ int scsi_sysfs_add_sdev(struct scsi_device *sdev) { - int error, i; + int error; struct scsi_target *starget = sdev->sdev_target; error = scsi_target_add(starget); @@ -1386,23 +1381,6 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev) } } - /* add additional host specific attributes */ - if (sdev->host->hostt->sdev_attrs) { - for (i = 0; sdev->host->hostt->sdev_attrs[i]; i++) { - error = device_create_file(&sdev->sdev_gendev, - sdev->host->hostt->sdev_attrs[i]); - if (error) - return error; - } - } - - if (sdev->host->hostt->sdev_groups) { - error = sysfs_create_groups(&sdev->sdev_gendev.kobj, - sdev->host->hostt->sdev_groups); - if (error) - return error; - } - scsi_autopm_put_device(sdev); return error; } @@ -1442,10 +1420,6 @@ void __scsi_remove_device(struct scsi_device *sdev) if (res != 0) return; - if (sdev->host->hostt->sdev_groups) - sysfs_remove_groups(&sdev->sdev_gendev.kobj, - sdev->host->hostt->sdev_groups); - if (IS_ENABLED(CONFIG_BLK_DEV_BSG) && sdev->bsg_dev) bsg_unregister_queue(sdev->bsg_dev); device_unregister(&sdev->sdev_dev); @@ -1584,23 +1558,31 @@ EXPORT_SYMBOL(scsi_register_interface); **/ int scsi_sysfs_add_host(struct Scsi_Host *shost) { - int error, i; - - /* add host specific attributes */ - if (shost->hostt->shost_attrs) { - for (i = 0; shost->hostt->shost_attrs[i]; i++) { - error = device_create_file(&shost->shost_dev, - shost->hostt->shost_attrs[i]); - if (error) - return error; - } - } - transport_register_device(&shost->shost_gendev); transport_configure_device(&shost->shost_gendev); return 0; } +/* + * Convert an array of struct device_attribute pointers into an array of + * struct attribute pointers. + */ +struct attribute **scsi_convert_dev_attrs(struct device *dev, + struct device_attribute **dev_attr) +{ + struct attribute **attrs; + int i; + + for (i = 0; dev_attr[i]; i++) + ; + attrs = devm_kzalloc(dev, (i + 1) * sizeof(*attrs), GFP_KERNEL); + if (!attrs) + return NULL; + for (i = 0; dev_attr[i]; i++) + attrs[i] = &dev_attr[i]->attr; + return attrs; +} + static struct device_type scsi_dev_type = { .name = "scsi_device", .release = scsi_device_dev_release, @@ -1609,8 +1591,10 @@ static struct device_type scsi_dev_type = { void scsi_sysfs_device_initialize(struct scsi_device *sdev) { + int i, j = 0; unsigned long flags; struct Scsi_Host *shost = sdev->host; + struct scsi_host_template *hostt = shost->hostt; struct scsi_target *starget = sdev->sdev_target; device_initialize(&sdev->sdev_gendev); @@ -1618,6 +1602,23 @@ void scsi_sysfs_device_initialize(struct scsi_device *sdev) sdev->sdev_gendev.type = &scsi_dev_type; dev_set_name(&sdev->sdev_gendev, "%d:%d:%d:%llu", sdev->host->host_no, sdev->channel, sdev->id, sdev->lun); + sdev->gendev_attr_groups[j++] = &scsi_sdev_attr_group; + if (hostt->sdev_attrs) { + sdev->lld_attr_group = (struct attribute_group){ + .attrs = scsi_convert_dev_attrs(&sdev->sdev_gendev, + hostt->sdev_attrs) + }; + if (sdev->lld_attr_group.attrs) + sdev->gendev_attr_groups[j++] = &sdev->lld_attr_group; + } + if (hostt->sdev_groups) { + for (i = 0; hostt->sdev_groups[i] && + j < ARRAY_SIZE(sdev->gendev_attr_groups); + i++, j++) { + sdev->gendev_attr_groups[j] = hostt->sdev_groups[i]; + } + } + WARN_ON_ONCE(j >= ARRAY_SIZE(sdev->gendev_attr_groups)); device_initialize(&sdev->sdev_dev); sdev->sdev_dev.parent = get_device(&sdev->sdev_gendev); diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index b97e142a7ca9..01732aabd7c3 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -225,6 +225,13 @@ struct scsi_device { struct device sdev_gendev, sdev_dev; + struct attribute_group lld_attr_group; + /* + * The array size 6 provides space for one attribute group for the + * SCSI core, four attribute groups defined by SCSI LLDs and one + * terminating NULL pointer. + */ + const struct attribute_group *gendev_attr_groups[6]; struct execute_work ew; /* used to get process context on put */ struct work_struct requeue_work; diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index bc9c45ced145..ab8775811e6f 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -483,6 +483,11 @@ struct scsi_host_template { */ struct device_attribute **sdev_attrs; + /* + * Pointer to the SCSI host sysfs attribute groups, NULL terminated. + */ + const struct attribute_group **shost_groups; + /* * Pointer to the SCSI device attribute groups for this host, * NULL terminated. @@ -695,6 +700,13 @@ struct Scsi_Host { /* ldm bits */ struct device shost_gendev, shost_dev; + struct attribute_group lld_attr_group; + /* + * The array size 3 provides space for one attribute group defined by + * the SCSI core, one attribute group defined by the SCSI LLD and one + * terminating NULL pointer. + */ + const struct attribute_group *shost_dev_attr_groups[3]; /* * Points to the transport data (if any) which is allocated From patchwork Fri Oct 8 20:23:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546291 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7DC72C433F5 for ; Fri, 8 Oct 2021 20:24:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5F12561073 for ; Fri, 8 Oct 2021 20:24:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242391AbhJHU0C (ORCPT ); Fri, 8 Oct 2021 16:26:02 -0400 Received: from mail-pg1-f180.google.com ([209.85.215.180]:37497 "EHLO mail-pg1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231590AbhJHUZ7 (ORCPT ); Fri, 8 Oct 2021 16:25:59 -0400 Received: by mail-pg1-f180.google.com with SMTP id r201so4161248pgr.4 for ; Fri, 08 Oct 2021 13:24:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iuaiSrAc3yHvAWUA6fwUVhcNybLtBXZ3G8LIf9qVR04=; b=SDO0qFxaz67LuM5Y4PmAzC740JGy9ELOisOn7jAUJvdnb3o5LtwXmL/2cQOAlgaYoJ 6pLQyu3QpcD9gHb3J369KKLyUhtyUr2H5lJY2da7tgAzSfu/arn1U2F9uSfhfVkSjXd7 xOFWdjcfB/xnwuvKMCV9+u2NfnlXwW8u5ts3/YZJtu4BT3tIFKhx6oqfvDwOc0Nrv6ii pUDj+UQdtKOD2eRd0wbaU405ya08JzH1OHXnxYdIfBV3BvNs1UhNFkzHP5ULiM2Y6oCQ srdVthXZXOi2mUTdI8NPZ3qFbcP9LHBflFd5+xFdXRMGI2gA+hHaTNd4uFHBZChtHLL/ /Yxw== X-Gm-Message-State: AOAM531Thsme+q+ky5xmF7Ep2ermkCu0N2e5C/w6pbwunHMQtzQouFEe LMkvnvzmFs58ZT5rWELRais= X-Google-Smtp-Source: ABdhPJx/Lgz/vYuoFXsPfWGq2vr6B+qaQ8LsMd8cO+sAYiZh5ZZMj4q4QCKnGJLqd06jKzqbZub+iw== X-Received: by 2002:a05:6a00:10c6:b0:44c:56ff:91ea with SMTP id d6-20020a056a0010c600b0044c56ff91eamr12141875pfu.25.1633724643103; Fri, 08 Oct 2021 13:24:03 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:02 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Damien Le Moal Subject: [PATCH v3 02/46] ata: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:09 -0700 Message-Id: <20211008202353.1448570-3-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche Acked-by: Damien Le Moal --- drivers/ata/ahci.h | 8 +++--- drivers/ata/ata_piix.c | 8 +++--- drivers/ata/libahci.c | 52 ++++++++++++++++++++++++++------------- drivers/ata/libata-sata.c | 19 ++++++++++---- drivers/ata/libata-scsi.c | 15 ++++++++--- drivers/ata/pata_macio.c | 2 +- drivers/ata/sata_mv.c | 2 +- drivers/ata/sata_nv.c | 4 +-- drivers/ata/sata_sil24.c | 2 +- include/linux/libata.h | 8 +++--- 10 files changed, 79 insertions(+), 41 deletions(-) diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h index 2e89499bd9c3..eeac5482f1d1 100644 --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h @@ -376,8 +376,8 @@ struct ahci_host_priv { extern int ahci_ignore_sss; -extern struct device_attribute *ahci_shost_attrs[]; -extern struct device_attribute *ahci_sdev_attrs[]; +extern const struct attribute_group *ahci_shost_groups[]; +extern const struct attribute_group *ahci_sdev_groups[]; /* * This must be instantiated by the edge drivers. Read the comments @@ -388,8 +388,8 @@ extern struct device_attribute *ahci_sdev_attrs[]; .can_queue = AHCI_MAX_CMDS, \ .sg_tablesize = AHCI_MAX_SG, \ .dma_boundary = AHCI_DMA_BOUNDARY, \ - .shost_attrs = ahci_shost_attrs, \ - .sdev_attrs = ahci_sdev_attrs, \ + .shost_groups = ahci_shost_groups, \ + .sdev_groups = ahci_sdev_groups, \ .change_queue_depth = ata_scsi_change_queue_depth, \ .tag_alloc_policy = BLK_TAG_ALLOC_RR, \ .slave_configure = ata_scsi_slave_config diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index 3ca7720e7d8f..0b2fcf0d1d6c 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c @@ -1085,14 +1085,16 @@ static struct ata_port_operations ich_pata_ops = { .set_dmamode = ich_set_dmamode, }; -static struct device_attribute *piix_sidpr_shost_attrs[] = { - &dev_attr_link_power_management_policy, +static struct attribute *piix_sidpr_shost_attrs[] = { + &dev_attr_link_power_management_policy.attr, NULL }; +ATTRIBUTE_GROUPS(piix_sidpr_shost); + static struct scsi_host_template piix_sidpr_sht = { ATA_BMDMA_SHT(DRV_NAME), - .shost_attrs = piix_sidpr_shost_attrs, + .shost_groups = piix_sidpr_shost_groups, }; static struct ata_port_operations piix_sidpr_sata_ops = { diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 5b3fa2cbe722..28430c093a7f 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -108,28 +108,46 @@ static DEVICE_ATTR(em_buffer, S_IWUSR | S_IRUGO, ahci_read_em_buffer, ahci_store_em_buffer); static DEVICE_ATTR(em_message_supported, S_IRUGO, ahci_show_em_supported, NULL); -struct device_attribute *ahci_shost_attrs[] = { - &dev_attr_link_power_management_policy, - &dev_attr_em_message_type, - &dev_attr_em_message, - &dev_attr_ahci_host_caps, - &dev_attr_ahci_host_cap2, - &dev_attr_ahci_host_version, - &dev_attr_ahci_port_cmd, - &dev_attr_em_buffer, - &dev_attr_em_message_supported, +static struct attribute *ahci_shost_attrs[] = { + &dev_attr_link_power_management_policy.attr, + &dev_attr_em_message_type.attr, + &dev_attr_em_message.attr, + &dev_attr_ahci_host_caps.attr, + &dev_attr_ahci_host_cap2.attr, + &dev_attr_ahci_host_version.attr, + &dev_attr_ahci_port_cmd.attr, + &dev_attr_em_buffer.attr, + &dev_attr_em_message_supported.attr, NULL }; -EXPORT_SYMBOL_GPL(ahci_shost_attrs); -struct device_attribute *ahci_sdev_attrs[] = { - &dev_attr_sw_activity, - &dev_attr_unload_heads, - &dev_attr_ncq_prio_supported, - &dev_attr_ncq_prio_enable, +static const struct attribute_group ahci_shost_attr_group = { + .attrs = ahci_shost_attrs +}; + +const struct attribute_group *ahci_shost_groups[] = { + &ahci_shost_attr_group, + NULL +}; +EXPORT_SYMBOL_GPL(ahci_shost_groups); + +struct attribute *ahci_sdev_attrs[] = { + &dev_attr_sw_activity.attr, + &dev_attr_unload_heads.attr, + &dev_attr_ncq_prio_supported.attr, + &dev_attr_ncq_prio_enable.attr, + NULL +}; + +static const struct attribute_group ahci_sdev_attr_group = { + .attrs = ahci_sdev_attrs +}; + +const struct attribute_group *ahci_sdev_groups[] = { + &ahci_sdev_attr_group, NULL }; -EXPORT_SYMBOL_GPL(ahci_sdev_attrs); +EXPORT_SYMBOL_GPL(ahci_sdev_groups); struct ata_port_operations ahci_ops = { .inherits = &sata_pmp_port_ops, diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c index 8f3ff830ab0c..79e0f86aa3ae 100644 --- a/drivers/ata/libata-sata.c +++ b/drivers/ata/libata-sata.c @@ -922,13 +922,22 @@ DEVICE_ATTR(ncq_prio_enable, S_IRUGO | S_IWUSR, ata_ncq_prio_enable_show, ata_ncq_prio_enable_store); EXPORT_SYMBOL_GPL(dev_attr_ncq_prio_enable); -struct device_attribute *ata_ncq_sdev_attrs[] = { - &dev_attr_unload_heads, - &dev_attr_ncq_prio_enable, - &dev_attr_ncq_prio_supported, +struct attribute *ata_ncq_sdev_attrs[] = { + &dev_attr_unload_heads.attr, + &dev_attr_ncq_prio_enable.attr, + &dev_attr_ncq_prio_supported.attr, NULL }; -EXPORT_SYMBOL_GPL(ata_ncq_sdev_attrs); + +static const struct attribute_group ata_ncq_sdev_attr_group = { + .attrs = ata_ncq_sdev_attrs +}; + +const struct attribute_group *ata_ncq_sdev_groups[] = { + &ata_ncq_sdev_attr_group, + NULL +}; +EXPORT_SYMBOL_GPL(ata_ncq_sdev_groups); static ssize_t ata_scsi_em_message_store(struct device *dev, struct device_attribute *attr, diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 1fb4611f7eeb..75c54b2761bf 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -234,11 +234,20 @@ static void ata_scsi_set_invalid_parameter(struct ata_device *dev, field, 0xff, 0); } -struct device_attribute *ata_common_sdev_attrs[] = { - &dev_attr_unload_heads, +static struct attribute *ata_common_sdev_attrs[] = { + &dev_attr_unload_heads.attr, NULL }; -EXPORT_SYMBOL_GPL(ata_common_sdev_attrs); + +static const struct attribute_group ata_common_sdev_attr_group = { + .attrs = ata_common_sdev_attrs +}; + +const struct attribute_group *ata_common_sdev_groups[] = { + &ata_common_sdev_attr_group, + NULL +}; +EXPORT_SYMBOL_GPL(ata_common_sdev_groups); /** * ata_std_bios_param - generic bios head/sector/cylinder calculator used by sd. diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c index be0ca8d5b345..16e8aa184a75 100644 --- a/drivers/ata/pata_macio.c +++ b/drivers/ata/pata_macio.c @@ -923,7 +923,7 @@ static struct scsi_host_template pata_macio_sht = { */ .max_segment_size = MAX_DBDMA_SEG, .slave_configure = pata_macio_slave_config, - .sdev_attrs = ata_common_sdev_attrs, + .sdev_groups = ata_common_sdev_groups, .can_queue = ATA_DEF_QUEUE, .tag_alloc_policy = BLK_TAG_ALLOC_RR, }; diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 9d86203e1e7a..24130e551b26 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c @@ -670,7 +670,7 @@ static struct scsi_host_template mv6_sht = { .can_queue = MV_MAX_Q_DEPTH - 1, .sg_tablesize = MV_MAX_SG_CT / 2, .dma_boundary = MV_DMA_BOUNDARY, - .sdev_attrs = ata_ncq_sdev_attrs, + .sdev_groups = ata_ncq_sdev_groups, .change_queue_depth = ata_scsi_change_queue_depth, .tag_alloc_policy = BLK_TAG_ALLOC_RR, .slave_configure = ata_scsi_slave_config diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index c385d18ce87b..16272c111208 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c @@ -380,7 +380,7 @@ static struct scsi_host_template nv_adma_sht = { .sg_tablesize = NV_ADMA_SGTBL_TOTAL_LEN, .dma_boundary = NV_ADMA_DMA_BOUNDARY, .slave_configure = nv_adma_slave_config, - .sdev_attrs = ata_ncq_sdev_attrs, + .sdev_groups = ata_ncq_sdev_groups, .change_queue_depth = ata_scsi_change_queue_depth, .tag_alloc_policy = BLK_TAG_ALLOC_RR, }; @@ -391,7 +391,7 @@ static struct scsi_host_template nv_swncq_sht = { .sg_tablesize = LIBATA_MAX_PRD, .dma_boundary = ATA_DMA_BOUNDARY, .slave_configure = nv_swncq_slave_config, - .sdev_attrs = ata_ncq_sdev_attrs, + .sdev_groups = ata_ncq_sdev_groups, .change_queue_depth = ata_scsi_change_queue_depth, .tag_alloc_policy = BLK_TAG_ALLOC_RR, }; diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c index 06a1e27c4f84..f99ec6f7d7c0 100644 --- a/drivers/ata/sata_sil24.c +++ b/drivers/ata/sata_sil24.c @@ -379,7 +379,7 @@ static struct scsi_host_template sil24_sht = { .sg_tablesize = SIL24_MAX_SGE, .dma_boundary = ATA_DMA_BOUNDARY, .tag_alloc_policy = BLK_TAG_ALLOC_FIFO, - .sdev_attrs = ata_ncq_sdev_attrs, + .sdev_groups = ata_ncq_sdev_groups, .change_queue_depth = ata_scsi_change_queue_depth, .slave_configure = ata_scsi_slave_config }; diff --git a/include/linux/libata.h b/include/linux/libata.h index c0c64f03e107..bd1b782d1bbf 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -1388,7 +1388,7 @@ extern int ata_link_nr_enabled(struct ata_link *link); */ extern const struct ata_port_operations ata_base_port_ops; extern const struct ata_port_operations sata_port_ops; -extern struct device_attribute *ata_common_sdev_attrs[]; +extern const struct attribute_group *ata_common_sdev_groups[]; /* * All sht initializers (BASE, PIO, BMDMA, NCQ) must be instantiated @@ -1418,14 +1418,14 @@ extern struct device_attribute *ata_common_sdev_attrs[]; #define ATA_BASE_SHT(drv_name) \ ATA_SUBBASE_SHT(drv_name), \ - .sdev_attrs = ata_common_sdev_attrs + .sdev_groups = ata_common_sdev_groups #ifdef CONFIG_SATA_HOST -extern struct device_attribute *ata_ncq_sdev_attrs[]; +extern const struct attribute_group *ata_ncq_sdev_groups[]; #define ATA_NCQ_SHT(drv_name) \ ATA_SUBBASE_SHT(drv_name), \ - .sdev_attrs = ata_ncq_sdev_attrs, \ + .sdev_groups = ata_ncq_sdev_groups, \ .change_queue_depth = ata_scsi_change_queue_depth #endif From patchwork Fri Oct 8 20:23:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546293 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC90EC4332F for ; Fri, 8 Oct 2021 20:24:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DA988610E5 for ; Fri, 8 Oct 2021 20:24:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242410AbhJHU0C (ORCPT ); Fri, 8 Oct 2021 16:26:02 -0400 Received: from mail-pg1-f177.google.com ([209.85.215.177]:38448 "EHLO mail-pg1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242293AbhJHU0A (ORCPT ); Fri, 8 Oct 2021 16:26:00 -0400 Received: by mail-pg1-f177.google.com with SMTP id s75so4159436pgs.5 for ; Fri, 08 Oct 2021 13:24:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4mdX3hkvfoYoF2fIUrn8m6GML1XzKXIEX378yasu53k=; b=s2ZcP35XRFnOWfMdjKbOjahN/MKhUbFyQ2zvhua5UInJJo4qcZcyp7KWZSlpYQUkDz qYkEnzF2fvBpMqiSt3LPrC8cRDPp+reRoP9swcANYm3Evo8rwg4L8qxA/HshxwDGohKi 5KKu4iQVdrgHP2PQMGaKYNovK2eAL7S3TQj3DFquBJfa0WnMILrBCW6GvXL8/IGPAawU tlwxB/IbmO7wLs38aW5YQ1KOVi3gnBWKZ9XuA4+3PR8VTiKnrCxqOcgc14HR4qU9Vm/Q tqUiZI8AfVf6TYAG1Vb2J0iOQCFXsA1NJu53jNxh/agUi7FwqsVHsNgJfxONPZw3E88e ptNQ== X-Gm-Message-State: AOAM53323f23cztNJDNUlKlvD876DJu6v41txFgRBFOxwfzWCzOpjh4V bakZTmrqGTe6/XhESE1fCac= X-Google-Smtp-Source: ABdhPJyEfTnMyPebJBxHqS+So5tumw9pv3ucLnGx9/rYIkd5rIJuL9+/P7wZX4NA2n6z7pzlM4zg7g== X-Received: by 2002:a62:5297:0:b0:3f4:263a:b078 with SMTP id g145-20020a625297000000b003f4263ab078mr12284853pfb.20.1633724644541; Fri, 08 Oct 2021 13:24:04 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:03 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Stefan Richter Subject: [PATCH v3 03/46] firewire: sbp2: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:10 -0700 Message-Id: <20211008202353.1448570-4-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/firewire/sbp2.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/firewire/sbp2.c b/drivers/firewire/sbp2.c index 4d5054211550..c2a9d7d0bd1e 100644 --- a/drivers/firewire/sbp2.c +++ b/drivers/firewire/sbp2.c @@ -1578,11 +1578,13 @@ static ssize_t sbp2_sysfs_ieee1394_id_show(struct device *dev, static DEVICE_ATTR(ieee1394_id, S_IRUGO, sbp2_sysfs_ieee1394_id_show, NULL); -static struct device_attribute *sbp2_scsi_sysfs_attrs[] = { - &dev_attr_ieee1394_id, +static struct attribute *sbp2_scsi_sysfs_attrs[] = { + &dev_attr_ieee1394_id.attr, NULL }; +ATTRIBUTE_GROUPS(sbp2_scsi_sysfs); + static struct scsi_host_template scsi_driver_template = { .module = THIS_MODULE, .name = "SBP-2 IEEE-1394", @@ -1595,7 +1597,7 @@ static struct scsi_host_template scsi_driver_template = { .sg_tablesize = SG_ALL, .max_segment_size = SBP2_MAX_SEG_SIZE, .can_queue = 1, - .sdev_attrs = sbp2_scsi_sysfs_attrs, + .sdev_groups = sbp2_scsi_sysfs_groups, }; MODULE_AUTHOR("Kristian Hoegsberg "); From patchwork Fri Oct 8 20:23:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546295 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B01DEC433F5 for ; Fri, 8 Oct 2021 20:24:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 95CB261019 for ; Fri, 8 Oct 2021 20:24:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242443AbhJHU0H (ORCPT ); Fri, 8 Oct 2021 16:26:07 -0400 Received: from mail-pf1-f176.google.com ([209.85.210.176]:40768 "EHLO mail-pf1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242366AbhJHU0B (ORCPT ); Fri, 8 Oct 2021 16:26:01 -0400 Received: by mail-pf1-f176.google.com with SMTP id o133so2844237pfg.7 for ; Fri, 08 Oct 2021 13:24:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/VigYoDqQaVLh8ZnJ8MkI1sXa+kkie0GLhmAN4WYaIg=; b=VAZJWlueH2pv8Sq32gR9b/lA7hHFaEY1ZTu2GFlWrI+ddtIufmed9hAuGoUdiDZRio GvX4viE5j16zpclFRWcjYPwXlP25J5uhpZAD6cczFgB2AjzGlp0scPNGk65yZPp+VIsv NeDJsj00P5AsnhrlA/PS7h2NTMMaF873iRcNlxOQ9Y9ZhwKV65+92hhcDxoQJfljgc+3 WpsZhjWBNMdXcUWJ3JnueWTvXJIhySS2k898e2ieNmu/DVs4JVpbMOhpiwEgbQEi048N Xbw4P8u59m9FJNqLtldaAuRRn/h4clb+VqaqQvpx2rCa6vQO9QNP34nAtOCV3BtGdQQ5 5vYg== X-Gm-Message-State: AOAM532rdyJAjmcPwCUiuQsik07hhVZseWv4k5j4QkE6xpenjaoJCU9O 9JApD0xALWuCfSG+T5NOSZE= X-Google-Smtp-Source: ABdhPJz3A5uXkE3XzWbs8q+H3JlSX4dBfI91PGd88W8NVfe8QeLaPV1OxRcmOXOV25RZ/YDF/2o90A== X-Received: by 2002:a63:dd45:: with SMTP id g5mr6378811pgj.236.1633724645930; Fri, 08 Oct 2021 13:24:05 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:05 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Doug Ledford , Jason Gunthorpe Subject: [PATCH v3 04/46] RDMA/srp: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:11 -0700 Message-Id: <20211008202353.1448570-5-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/infiniband/ulp/srp/ib_srp.c | 51 +++++++++++++++++------------ 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 71eda91e810c..089e09bfe002 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -1026,10 +1026,17 @@ static int srp_init_cmd_priv(struct Scsi_Host *shost, struct scsi_cmnd *cmd) */ static void srp_del_scsi_host_attr(struct Scsi_Host *shost) { - struct device_attribute **attr; + const struct attribute_group **g; + struct attribute **attr; - for (attr = shost->hostt->shost_attrs; attr && *attr; ++attr) - device_remove_file(&shost->shost_dev, *attr); + for (g = shost->hostt->shost_groups; *g; ++g) { + for (attr = (*g)->attrs; *attr; ++attr) { + struct device_attribute *dev_attr = + container_of(*attr, typeof(*dev_attr), attr); + + device_remove_file(&shost->shost_dev, dev_attr); + } + } } static void srp_remove_target(struct srp_target_port *target) @@ -3050,26 +3057,28 @@ static ssize_t allow_ext_sg_show(struct device *dev, static DEVICE_ATTR_RO(allow_ext_sg); -static struct device_attribute *srp_host_attrs[] = { - &dev_attr_id_ext, - &dev_attr_ioc_guid, - &dev_attr_service_id, - &dev_attr_pkey, - &dev_attr_sgid, - &dev_attr_dgid, - &dev_attr_orig_dgid, - &dev_attr_req_lim, - &dev_attr_zero_req_lim, - &dev_attr_local_ib_port, - &dev_attr_local_ib_device, - &dev_attr_ch_count, - &dev_attr_comp_vector, - &dev_attr_tl_retry_count, - &dev_attr_cmd_sg_entries, - &dev_attr_allow_ext_sg, +static struct attribute *srp_host_attrs[] = { + &dev_attr_id_ext.attr, + &dev_attr_ioc_guid.attr, + &dev_attr_service_id.attr, + &dev_attr_pkey.attr, + &dev_attr_sgid.attr, + &dev_attr_dgid.attr, + &dev_attr_orig_dgid.attr, + &dev_attr_req_lim.attr, + &dev_attr_zero_req_lim.attr, + &dev_attr_local_ib_port.attr, + &dev_attr_local_ib_device.attr, + &dev_attr_ch_count.attr, + &dev_attr_comp_vector.attr, + &dev_attr_tl_retry_count.attr, + &dev_attr_cmd_sg_entries.attr, + &dev_attr_allow_ext_sg.attr, NULL }; +ATTRIBUTE_GROUPS(srp_host); + static struct scsi_host_template srp_template = { .module = THIS_MODULE, .name = "InfiniBand SRP initiator", @@ -3090,7 +3099,7 @@ static struct scsi_host_template srp_template = { .can_queue = SRP_DEFAULT_CMD_SQ_SIZE, .this_id = -1, .cmd_per_lun = SRP_DEFAULT_CMD_SQ_SIZE, - .shost_attrs = srp_host_attrs, + .shost_groups = srp_host_groups, .track_queue_depth = 1, .cmd_size = sizeof(struct srp_request), }; From patchwork Fri Oct 8 20:23:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546297 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23BBEC433FE for ; Fri, 8 Oct 2021 20:24:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0BDB661040 for ; Fri, 8 Oct 2021 20:24:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242456AbhJHU0I (ORCPT ); Fri, 8 Oct 2021 16:26:08 -0400 Received: from mail-pj1-f50.google.com ([209.85.216.50]:41642 "EHLO mail-pj1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242293AbhJHU0D (ORCPT ); Fri, 8 Oct 2021 16:26:03 -0400 Received: by mail-pj1-f50.google.com with SMTP id na16-20020a17090b4c1000b0019f5bb661f9so8688391pjb.0 for ; Fri, 08 Oct 2021 13:24:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gA6NRNH2A9Xt41KnXTAILbLbUYLHxLunMHE6eX3ZNbw=; b=wIbdiAHIECrwd+0jHU4vMFEduXThQ/AFlRuzBUCAYdOIsOwS2jA7ygy06gQKQRNjZw 8i1R5BHKys916uczVoc75AEom1Urg91kaGyJcG3KE+oUxZ2mZPPrSJYHrApfacBEOlQs VMmgzWoHrD9SNbNe51hUj0vtKBCW3y3SmO91YJvfB6Cv09cQXTna/PUezZUkyhjTu/ZW 9GRXKhXrVAvwRYQPJHGZ0BfUSPP0IC3/+ARImq6WwZc7y2sEqQx3t2ZQTguo6S8VlPYA 7rsmrsoNXTueOvkp7o4uuYZ3dH6sHsB19Z2+hfhcoeR2O8capcjUk7fX8t0YZlWA7NgM YENA== X-Gm-Message-State: AOAM5332cpC4I+v+wCA3J9QCyjqdec3QvdAD+A9ZSj3e9zeQLCopw/Fx 6gmuHC0c8BLOnKSvljjqu15/Y101YZqDbw== X-Google-Smtp-Source: ABdhPJxoFgoYqcHf7WSMprP9G2kX+9XIG3O2FCmQBeVpl7/flGkWKbAwNogLa1DojwPpUHzBltiIew== X-Received: by 2002:a17:90b:388a:: with SMTP id mu10mr14189682pjb.0.1633724647488; Fri, 08 Oct 2021 13:24:07 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:06 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Sathya Prakash , Sreekanth Reddy , Suganath Prabu Subramani Subject: [PATCH v3 05/46] scsi: message: fusion: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:12 -0700 Message-Id: <20211008202353.1448570-6-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/message/fusion/mptfc.c | 2 +- drivers/message/fusion/mptsas.c | 2 +- drivers/message/fusion/mptscsih.c | 36 +++++++++++++++++++------------ drivers/message/fusion/mptscsih.h | 2 +- drivers/message/fusion/mptspi.c | 2 +- 5 files changed, 26 insertions(+), 18 deletions(-) diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index 572333fadd68..ecca95d2b9bf 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c @@ -129,7 +129,7 @@ static struct scsi_host_template mptfc_driver_template = { .sg_tablesize = MPT_SCSI_SG_DEPTH, .max_sectors = 8192, .cmd_per_lun = 7, - .shost_attrs = mptscsih_host_attrs, + .shost_groups = mptscsih_host_attr_groups, }; /**************************************************************************** diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 85285ba8e817..e31167446a02 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c @@ -2020,7 +2020,7 @@ static struct scsi_host_template mptsas_driver_template = { .sg_tablesize = MPT_SCSI_SG_DEPTH, .max_sectors = 8192, .cmd_per_lun = 7, - .shost_attrs = mptscsih_host_attrs, + .shost_groups = mptscsih_host_attr_groups, .no_write_same = 1, }; diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index ce2e5b21978e..03573670c395 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c @@ -3218,23 +3218,31 @@ mptscsih_debug_level_store(struct device *dev, struct device_attribute *attr, static DEVICE_ATTR(debug_level, S_IRUGO | S_IWUSR, mptscsih_debug_level_show, mptscsih_debug_level_store); -struct device_attribute *mptscsih_host_attrs[] = { - &dev_attr_version_fw, - &dev_attr_version_bios, - &dev_attr_version_mpi, - &dev_attr_version_product, - &dev_attr_version_nvdata_persistent, - &dev_attr_version_nvdata_default, - &dev_attr_board_name, - &dev_attr_board_assembly, - &dev_attr_board_tracer, - &dev_attr_io_delay, - &dev_attr_device_delay, - &dev_attr_debug_level, +static struct attribute *mptscsih_host_attrs[] = { + &dev_attr_version_fw.attr, + &dev_attr_version_bios.attr, + &dev_attr_version_mpi.attr, + &dev_attr_version_product.attr, + &dev_attr_version_nvdata_persistent.attr, + &dev_attr_version_nvdata_default.attr, + &dev_attr_board_name.attr, + &dev_attr_board_assembly.attr, + &dev_attr_board_tracer.attr, + &dev_attr_io_delay.attr, + &dev_attr_device_delay.attr, + &dev_attr_debug_level.attr, NULL, }; -EXPORT_SYMBOL(mptscsih_host_attrs); +static const struct attribute_group mptscsih_host_attr_group = { + .attrs = mptscsih_host_attrs +}; + +const struct attribute_group *mptscsih_host_attr_groups[] = { + &mptscsih_host_attr_group, + NULL +}; +EXPORT_SYMBOL(mptscsih_host_attr_groups); EXPORT_SYMBOL(mptscsih_remove); EXPORT_SYMBOL(mptscsih_shutdown); diff --git a/drivers/message/fusion/mptscsih.h b/drivers/message/fusion/mptscsih.h index 2baeefd9be7a..a22c5eaf703c 100644 --- a/drivers/message/fusion/mptscsih.h +++ b/drivers/message/fusion/mptscsih.h @@ -131,7 +131,7 @@ extern int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset); extern int mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth); extern u8 mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id); extern int mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id); -extern struct device_attribute *mptscsih_host_attrs[]; +extern const struct attribute_group *mptscsih_host_attr_groups[]; extern struct scsi_cmnd *mptscsih_get_scsi_lookup(MPT_ADAPTER *ioc, int i); extern void mptscsih_taskmgmt_response_code(MPT_ADAPTER *ioc, u8 response_code); extern void mptscsih_flush_running_cmds(MPT_SCSI_HOST *hd); diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index af0ce5611e4a..63c25877a413 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c @@ -843,7 +843,7 @@ static struct scsi_host_template mptspi_driver_template = { .sg_tablesize = MPT_SCSI_SG_DEPTH, .max_sectors = 8192, .cmd_per_lun = 7, - .shost_attrs = mptscsih_host_attrs, + .shost_groups = mptscsih_host_attr_groups, }; static int mptspi_write_spi_device_pg1(struct scsi_target *starget, From patchwork Fri Oct 8 20:23:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546299 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3E5AC4332F for ; Fri, 8 Oct 2021 20:24:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BBD0461040 for ; Fri, 8 Oct 2021 20:24:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242525AbhJHU0I (ORCPT ); Fri, 8 Oct 2021 16:26:08 -0400 Received: from mail-pl1-f180.google.com ([209.85.214.180]:36594 "EHLO mail-pl1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242416AbhJHU0E (ORCPT ); Fri, 8 Oct 2021 16:26:04 -0400 Received: by mail-pl1-f180.google.com with SMTP id k8so1438691pls.3 for ; Fri, 08 Oct 2021 13:24:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=x+9C4XCnXMufnM3Q7VuIyOB8HVogXKqFNg495nbR0Dk=; b=VAwlia7md/MNFAW5+XT3ntIzDlBi5VA83JSQ730HQ0D3tYYqYyItqK6jlxd1jly4Pt wKMTJ7YHQBPMIzlnHPIxa6Ck4xLOupBvG78NkkIGZiOWIMWG+zPOlUY6oRHkBnLGZ/uh EeecM7moIraKNIaGGQIL7h7sE2IYCsZ7AIEzppoD5HdMjlQPEKgamuDGYjTLVplBd8V+ MgxGR8lwY3Tqh+gjCjc3s3M8dfYUbGqWaHIqvP9QW/kcp+GMLdAHXgoAm9AwlNv/Qumn OQIRuo5Da8gwd7hanqGE76JGMLrnmeaCIM8Ty1MAb3SgmlaiMYlGtIxA9p30jhkdyO/e 4NfA== X-Gm-Message-State: AOAM530Nu0IMy95YtBBkLLeNHqxrG1D2hWg+k3o3J4F4QkbFpIaymIOb uJR7APEsCdqZdGokdoyLkbU= X-Google-Smtp-Source: ABdhPJz6frnr06L8JXGMJ6O8qT4bbdrWFW9wLasPz5BjX5/E4lGwd3HDfUb/ZEwmElvrUM0tLSHwGQ== X-Received: by 2002:a17:902:7ec2:b0:13d:b563:c39 with SMTP id p2-20020a1709027ec200b0013db5630c39mr11339150plb.14.1633724649104; Fri, 08 Oct 2021 13:24:09 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:08 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Steffen Maier , Benjamin Block , Heiko Carstens , Vasily Gorbik , Christian Borntraeger Subject: [PATCH v3 06/46] scsi: zfcp: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:13 -0700 Message-Id: <20211008202353.1448570-7-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/s390/scsi/zfcp_ext.h | 4 +-- drivers/s390/scsi/zfcp_scsi.c | 4 +-- drivers/s390/scsi/zfcp_sysfs.c | 52 +++++++++++++++++++++++----------- 3 files changed, 39 insertions(+), 21 deletions(-) diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h index 6bc96d70254d..7b7b567186d6 100644 --- a/drivers/s390/scsi/zfcp_ext.h +++ b/drivers/s390/scsi/zfcp_ext.h @@ -184,8 +184,8 @@ extern const struct attribute_group *zfcp_sysfs_adapter_attr_groups[]; extern const struct attribute_group *zfcp_unit_attr_groups[]; extern const struct attribute_group *zfcp_port_attr_groups[]; extern struct mutex zfcp_sysfs_port_units_mutex; -extern struct device_attribute *zfcp_sysfs_sdev_attrs[]; -extern struct device_attribute *zfcp_sysfs_shost_attrs[]; +extern const struct attribute_group *zfcp_sdev_attr_groups[]; +extern const struct attribute_group *zfcp_shost_attr_groups[]; bool zfcp_sysfs_port_is_removing(const struct zfcp_port *const port); /* zfcp_unit.c */ diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index 9da9b2b2a580..0b40e2331f97 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c @@ -444,8 +444,8 @@ static struct scsi_host_template zfcp_scsi_host_template = { /* report size limit per scatter-gather segment */ .max_segment_size = ZFCP_QDIO_SBALE_LEN, .dma_boundary = ZFCP_QDIO_SBALE_LEN - 1, - .shost_attrs = zfcp_sysfs_shost_attrs, - .sdev_attrs = zfcp_sysfs_sdev_attrs, + .shost_groups = zfcp_shost_attr_groups, + .sdev_groups = zfcp_sdev_attr_groups, .track_queue_depth = 1, .supported_mode = MODE_INITIATOR, }; diff --git a/drivers/s390/scsi/zfcp_sysfs.c b/drivers/s390/scsi/zfcp_sysfs.c index b8cd75a872ee..fe1974658d82 100644 --- a/drivers/s390/scsi/zfcp_sysfs.c +++ b/drivers/s390/scsi/zfcp_sysfs.c @@ -672,17 +672,26 @@ ZFCP_DEFINE_SCSI_ATTR(zfcp_in_recovery, "%d\n", ZFCP_DEFINE_SCSI_ATTR(zfcp_status, "0x%08x\n", atomic_read(&zfcp_sdev->status)); -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, - &dev_attr_zfcp_access_denied, - &dev_attr_zfcp_failed, - &dev_attr_zfcp_in_recovery, - &dev_attr_zfcp_status, +struct attribute *zfcp_sdev_attrs[] = { + &dev_attr_fcp_lun.attr, + &dev_attr_wwpn.attr, + &dev_attr_hba_id.attr, + &dev_attr_read_latency.attr, + &dev_attr_write_latency.attr, + &dev_attr_cmd_latency.attr, + &dev_attr_zfcp_access_denied.attr, + &dev_attr_zfcp_failed.attr, + &dev_attr_zfcp_in_recovery.attr, + &dev_attr_zfcp_status.attr, + NULL +}; + +static const struct attribute_group zfcp_sdev_attr_group = { + .attrs = zfcp_sdev_attrs +}; + +const struct attribute_group *zfcp_sdev_attr_groups[] = { + &zfcp_sdev_attr_group, NULL }; @@ -783,12 +792,21 @@ static ssize_t zfcp_sysfs_adapter_q_full_show(struct device *dev, } static DEVICE_ATTR(queue_full, S_IRUGO, zfcp_sysfs_adapter_q_full_show, NULL); -struct device_attribute *zfcp_sysfs_shost_attrs[] = { - &dev_attr_utilization, - &dev_attr_requests, - &dev_attr_megabytes, - &dev_attr_seconds_active, - &dev_attr_queue_full, +static struct attribute *zfcp_sysfs_shost_attrs[] = { + &dev_attr_utilization.attr, + &dev_attr_requests.attr, + &dev_attr_megabytes.attr, + &dev_attr_seconds_active.attr, + &dev_attr_queue_full.attr, + NULL +}; + +static const struct attribute_group zfcp_shost_attr_group = { + .attrs = zfcp_sysfs_shost_attrs +}; + +const struct attribute_group *zfcp_shost_attr_groups[] = { + &zfcp_shost_attr_group, NULL }; From patchwork Fri Oct 8 20:23:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546303 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 736D4C433EF for ; Fri, 8 Oct 2021 20:24:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5C222610E5 for ; Fri, 8 Oct 2021 20:24:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242494AbhJHU0I (ORCPT ); Fri, 8 Oct 2021 16:26:08 -0400 Received: from mail-pg1-f170.google.com ([209.85.215.170]:35518 "EHLO mail-pg1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232013AbhJHU0G (ORCPT ); Fri, 8 Oct 2021 16:26:06 -0400 Received: by mail-pg1-f170.google.com with SMTP id e7so4177714pgk.2 for ; Fri, 08 Oct 2021 13:24:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dTNedSEFjqtd+pJzmAKavcMIBaVjV9fuMU4exKPIasc=; b=gN4I/GQ/Yw5ZoJpLjRY6dWFNP6Xs8v/k2Yjabrzmm81RcKLzHyxMy6JTFfDqnhgPZv Gqo2TOh0BDfTulpEqvL1zqklqGBQZ3PoeaJy7ndafJGbGnBBZfidLjRy84y2Gsb19/bY RVtR3CONhCcNbxj+cjWmBfxpokPKKC5+nyZqujwry5+eIzuoDqWG7dTGLq7tce60YD9x 9s/VuyVZ/J/STiug0BTBuZObQaEYV3MQag0RXsGh3CAT70etZKiIyeE71Zdn9YojpTme lEm+AXR8f+sg63o1VpKPkH9tJaqPgOQr0dJHIzF0UKCoWlJXvhJSuRRQSNM2o/aD0LQl ZCJA== X-Gm-Message-State: AOAM533f9BBehV0Rs9yCl91fdA86m8o9OWB1zM4yTrbvoXsb9CImOGVT uj8CgpjyocxDnsuobkm7STw= X-Google-Smtp-Source: ABdhPJw/HBS2B3jakbuOmGNgvRTI4WXjCQoqOu0LsIPXIiafYaZXRTKm4NPc321NcRFOrhwdSjOCuA== X-Received: by 2002:a63:b04c:: with SMTP id z12mr6252804pgo.371.1633724650527; Fri, 08 Oct 2021 13:24:10 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:09 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Adam Radford , "James E.J. Bottomley" Subject: [PATCH v3 07/46] scsi: 3w-9xxx: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:14 -0700 Message-Id: <20211008202353.1448570-8-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/3w-9xxx.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index e41cc354cc8a..a2a42f29bc06 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c @@ -197,11 +197,13 @@ static struct device_attribute twa_host_stats_attr = { }; /* Host attributes initializer */ -static struct device_attribute *twa_host_attrs[] = { - &twa_host_stats_attr, +static struct attribute *twa_host_attrs[] = { + &twa_host_stats_attr.attr, NULL, }; +ATTRIBUTE_GROUPS(twa_host); + /* File operations struct for character device */ static const struct file_operations twa_fops = { .owner = THIS_MODULE, @@ -1990,7 +1992,7 @@ static struct scsi_host_template driver_template = { .sg_tablesize = TW_APACHE_MAX_SGL_LENGTH, .max_sectors = TW_MAX_SECTORS, .cmd_per_lun = TW_MAX_CMDS_PER_LUN, - .shost_attrs = twa_host_attrs, + .shost_groups = twa_host_groups, .emulated = 1, .no_write_same = 1, }; From patchwork Fri Oct 8 20:23:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546301 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4CE6EC43219 for ; Fri, 8 Oct 2021 20:24:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3783861073 for ; Fri, 8 Oct 2021 20:24:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242537AbhJHU0J (ORCPT ); Fri, 8 Oct 2021 16:26:09 -0400 Received: from mail-pj1-f53.google.com ([209.85.216.53]:33721 "EHLO mail-pj1-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242366AbhJHU0H (ORCPT ); Fri, 8 Oct 2021 16:26:07 -0400 Received: by mail-pj1-f53.google.com with SMTP id cs11-20020a17090af50b00b0019fe3df3dddso7747757pjb.0 for ; Fri, 08 Oct 2021 13:24:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MjKCG2T1ZRnPvoHNzt683A74Q4/xP4EPAort/dG+Q+Y=; b=QUvXsxbnupKNY1xut5WDei4YCpk0N2DM1Fk9sBa6TAmZRzZ5P0dd6eGfV6DHMf/ham gS9X5xTn/mmNCPwSN8ahZk0SAqyvga1ojbMK0ShVHVe9RsG5Q1CmpWE5QfEK1Ndn0imK 0PnDsuRtviqINhlu2CwX4Y6FTyVPqND2C3zAOYG/jIu/7RexOdThjZ4RGfKd5DQIUAE9 s2LmkOifVLUqQ12HQ9kitu/GCuQNI+1roj+PLxQ3HQ3sA40yViLfvnN63vMXt11nl9d5 x7JWu2xTfPB06oWH4fdIq6/T8D1rx1nZ/bdsrRGMqNXnRo0g1X5fs4h8YuSjEMf9Y8kS cLVg== X-Gm-Message-State: AOAM530vr39jFyPBWkUkjHbEAZcCY6o4QA0gIzWF1Dh6f9pL6dcyZ43c McJ9VEIBxq9gDFyMCK66wi0= X-Google-Smtp-Source: ABdhPJwYHzDyQmIazIyvyoRJcGdfgI3IFFgu37GEAT6mR7qbYfepI4W5DME56EzKE5cK4KZurdB7Ug== X-Received: by 2002:a17:903:283:b0:13e:f38c:2282 with SMTP id j3-20020a170903028300b0013ef38c2282mr10973087plr.82.1633724651872; Fri, 08 Oct 2021 13:24:11 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:11 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Adam Radford , "James E.J. Bottomley" Subject: [PATCH v3 08/46] scsi: 3w-sas: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:15 -0700 Message-Id: <20211008202353.1448570-9-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/3w-sas.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c index 4fde39da54e4..42414a58f368 100644 --- a/drivers/scsi/3w-sas.c +++ b/drivers/scsi/3w-sas.c @@ -198,11 +198,13 @@ static struct device_attribute twl_host_stats_attr = { }; /* Host attributes initializer */ -static struct device_attribute *twl_host_attrs[] = { - &twl_host_stats_attr, +static struct attribute *twl_host_attrs[] = { + &twl_host_stats_attr.attr, NULL, }; +ATTRIBUTE_GROUPS(twl_host); + /* This function will look up an AEN severity string */ static char *twl_aen_severity_lookup(unsigned char severity_code) { @@ -1544,7 +1546,7 @@ static struct scsi_host_template driver_template = { .sg_tablesize = TW_LIBERATOR_MAX_SGL_LENGTH, .max_sectors = TW_MAX_SECTORS, .cmd_per_lun = TW_MAX_CMDS_PER_LUN, - .shost_attrs = twl_host_attrs, + .shost_groups = twl_host_groups, .emulated = 1, .no_write_same = 1, }; From patchwork Fri Oct 8 20:23:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546305 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49739C433EF for ; Fri, 8 Oct 2021 20:24:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 32F9A610E7 for ; Fri, 8 Oct 2021 20:24:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242366AbhJHU0N (ORCPT ); Fri, 8 Oct 2021 16:26:13 -0400 Received: from mail-pf1-f171.google.com ([209.85.210.171]:41872 "EHLO mail-pf1-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242416AbhJHU0J (ORCPT ); Fri, 8 Oct 2021 16:26:09 -0400 Received: by mail-pf1-f171.google.com with SMTP id p1so9099187pfh.8 for ; Fri, 08 Oct 2021 13:24:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kSy9HxHylqv2QQOMeguWwGRixQQsbcPSN7ac2lLyVBI=; b=MxbfGKW9LZadR2FNXcFPk/ro7GkqK2bbhjrwS0wtk36wtOtwB0+fitqDM+9fsAVsIV lk1t5v0mqx481XTgGSkZ9IKbEFQtcaXFoSze2HBl6TC7heWMxe5IV6PCIsb2gKohdHP2 rGCdSpD2Voe+ZBJGhPsA4FewwK0TaHWJP80fEsSyKnEf0r+6JkPunTKbz1pQDguRAwIC wvxQDFXppar8M9+hUbGwaMz5jvf/hNOqcMZRWY1IkFnSv4df20qiv7Fm+Yjkfw9XrzPy dDYIL2/DlvcRutIRyGGdRmkESCKGowp1tbzurmdy6lFWrUTcWSr2Ffcoty6sZkcAQIXi 4nLA== X-Gm-Message-State: AOAM531XTI5YI0ash36IcxmMQ6zZXpMJCluX+konqe5lE+rGc5j85tym Ne9WSwkyLwTA+S4lfiRFiK4= X-Google-Smtp-Source: ABdhPJwemukT8rNfwgcjAid6+aQghtzxa5Dt7Q5pAjxmQ0Z+/QEby/UTBe2GKCwrwu0UOjwe5G3alw== X-Received: by 2002:a63:3301:: with SMTP id z1mr6436264pgz.120.1633724653219; Fri, 08 Oct 2021 13:24:13 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:12 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Adam Radford , "James E.J. Bottomley" Subject: [PATCH v3 09/46] scsi: 3w-xxxx: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:16 -0700 Message-Id: <20211008202353.1448570-10-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/3w-xxxx.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c index 4ee485ab2714..db4e5449d516 100644 --- a/drivers/scsi/3w-xxxx.c +++ b/drivers/scsi/3w-xxxx.c @@ -532,11 +532,13 @@ static struct device_attribute tw_host_stats_attr = { }; /* Host attributes initializer */ -static struct device_attribute *tw_host_attrs[] = { - &tw_host_stats_attr, +static struct attribute *tw_host_attrs[] = { + &tw_host_stats_attr.attr, NULL, }; +ATTRIBUTE_GROUPS(tw_host); + /* This function will read the aen queue from the isr */ static int tw_aen_read_queue(TW_Device_Extension *tw_dev, int request_id) { @@ -2242,7 +2244,7 @@ static struct scsi_host_template driver_template = { .sg_tablesize = TW_MAX_SGL_LENGTH, .max_sectors = TW_MAX_SECTORS, .cmd_per_lun = TW_MAX_CMDS_PER_LUN, - .shost_attrs = tw_host_attrs, + .shost_groups = tw_host_groups, .emulated = 1, .no_write_same = 1, }; From patchwork Fri Oct 8 20:23:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546307 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6916C433F5 for ; Fri, 8 Oct 2021 20:24:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9C467610E7 for ; Fri, 8 Oct 2021 20:24:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242591AbhJHU0N (ORCPT ); Fri, 8 Oct 2021 16:26:13 -0400 Received: from mail-pf1-f170.google.com ([209.85.210.170]:33607 "EHLO mail-pf1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242570AbhJHU0M (ORCPT ); Fri, 8 Oct 2021 16:26:12 -0400 Received: by mail-pf1-f170.google.com with SMTP id s16so9166537pfk.0 for ; Fri, 08 Oct 2021 13:24:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bke2QLpps6GpzDcXZNnBKyGGpzVgxKxfRpS6Pp+DtoM=; b=bWKF3QzZl3Ag9qjACPcdjCgrbbIGrS7p4fau6MoEg6W44roxJHzt1m3FqVc+raidQ3 RXWaMpfRTW6XINiQ5NWGSAsdc0rjVW1r0Jhyu6N1GgDxbfLD3OU2CI9DI4Rnht6Qd/Ne bYy0nKtfjELAnBZV7vMUAQ6NlrtkzgpWlG09RfbTNPoH5ZEehM+MgF3y6P7ysUO8Fqev dd1sx7jng7W6mgIebVBD1x9J6gV0Y0idMZZvVUrqwlnfZX99VmYJ9WlpfBOhvxy/GGVR VGnuHyDoVdJdtBtA+7inOUrhmnyE+tZ3iWyIterinPntJFlsg9fTlYtwqcB2+RnF44By 9pQA== X-Gm-Message-State: AOAM530Dj/xcOSid5+kuvSASt1VmGAxuKUSf8+ojI2GRI1RtOUYLePmo JtU4vYBRytq0zUP27NMhJ5Lyazqerdl3CQ== X-Google-Smtp-Source: ABdhPJx0cFLO3C3sAsq6yNtBalM2KSN/K8/baY6fJiwZLvGYSIIXaTYacEHYkXBYwPfGNSRbS/63Bw== X-Received: by 2002:a63:4f25:: with SMTP id d37mr6476015pgb.61.1633724654578; Fri, 08 Oct 2021 13:24:14 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:14 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , "James E.J. Bottomley" Subject: [PATCH v3 10/46] scsi: 53c700: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:17 -0700 Message-Id: <20211008202353.1448570-11-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/53c700.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/53c700.c b/drivers/scsi/53c700.c index a12e3525977d..931f9d44e83c 100644 --- a/drivers/scsi/53c700.c +++ b/drivers/scsi/53c700.c @@ -163,7 +163,7 @@ STATIC int NCR_700_slave_configure(struct scsi_device *SDpnt); STATIC void NCR_700_slave_destroy(struct scsi_device *SDpnt); static int NCR_700_change_queue_depth(struct scsi_device *SDpnt, int depth); -STATIC struct device_attribute *NCR_700_dev_attrs[]; +STATIC const struct attribute_group *NCR_700_dev_groups[]; STATIC struct scsi_transport_template *NCR_700_transport_template = NULL; @@ -300,8 +300,8 @@ NCR_700_detect(struct scsi_host_template *tpnt, static int banner = 0; int j; - if(tpnt->sdev_attrs == NULL) - tpnt->sdev_attrs = NCR_700_dev_attrs; + if (tpnt->sdev_groups == NULL) + tpnt->sdev_groups = NCR_700_dev_groups; memory = dma_alloc_coherent(dev, TOTAL_MEM_SIZE, &pScript, GFP_KERNEL); if (!memory) { @@ -2087,11 +2087,13 @@ static struct device_attribute NCR_700_active_tags_attr = { .show = NCR_700_show_active_tags, }; -STATIC struct device_attribute *NCR_700_dev_attrs[] = { - &NCR_700_active_tags_attr, +STATIC struct attribute *NCR_700_dev_attrs[] = { + &NCR_700_active_tags_attr.attr, NULL, }; +ATTRIBUTE_GROUPS(NCR_700_dev); + EXPORT_SYMBOL(NCR_700_detect); EXPORT_SYMBOL(NCR_700_release); EXPORT_SYMBOL(NCR_700_intr); From patchwork Fri Oct 8 20:23:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546309 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BF57C433FE for ; Fri, 8 Oct 2021 20:24:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 24B1B610E7 for ; Fri, 8 Oct 2021 20:24:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242635AbhJHU0O (ORCPT ); Fri, 8 Oct 2021 16:26:14 -0400 Received: from mail-pg1-f170.google.com ([209.85.215.170]:35525 "EHLO mail-pg1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242602AbhJHU0M (ORCPT ); Fri, 8 Oct 2021 16:26:12 -0400 Received: by mail-pg1-f170.google.com with SMTP id e7so4177881pgk.2 for ; Fri, 08 Oct 2021 13:24:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=q3dt644jJFcxByiVopzbHO/3VhgDBHnjcH7YBR0cYF4=; b=iJ2Q5C3JfxIRcvDYEA1NHMaLs5eD+qS2ZSHO6vOYxSpg6wsoECHzjJYvUnnjEC/udi nBNxEjsPGrur1XfCX1VaFNah80JP2CJubue7GDc5tu7PY6eaEnlZj7K+wZ6eRR6EExnr M/QQ0aSIwT01P+k0UHLAYTYSF9xqJgy+g0FEKR1qizXTo0jMWLK0P8rgLADvPTZQjcuL rircZ6r3JalcbWUZDjfwcB7AhUFRuODZTFxO1aBH1ICnljcn9xbK8g8qLko/TR7+6Wrt Etb/pAtS2kJ8X9MYpqbEu6bSqQJWj5s+IGzOz2JFRwatQAyB+NS6c9Hlri5bs2DcJ891 luLA== X-Gm-Message-State: AOAM531aZrfYk8bC91zoI5i/EtOMa/hBWc7llKXN4OYcwRSgAVvG8LyJ NB/Uh4IUPpinJQtKiU95i0LzM2gVSYxfGA== X-Google-Smtp-Source: ABdhPJwFOx0ZvElsNtFQ3M9MlQv37XlpGTdLlChRmrp7W0JWjZt7KNeh8OKre9MKn1q0ySrxB8gawg== X-Received: by 2002:a63:e002:: with SMTP id e2mr6276560pgh.386.1633724655989; Fri, 08 Oct 2021 13:24:15 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:15 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Adaptec OEM Raid Solutions , "James E.J. Bottomley" Subject: [PATCH v3 11/46] scsi: aacraid: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:18 -0700 Message-Id: <20211008202353.1448570-12-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/aacraid/linit.c | 38 ++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index 3168915adaa7..a911252075a6 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c @@ -605,12 +605,14 @@ static struct device_attribute aac_unique_id_attr = { -static struct device_attribute *aac_dev_attrs[] = { - &aac_raid_level_attr, - &aac_unique_id_attr, +static struct attribute *aac_dev_attrs[] = { + &aac_raid_level_attr.attr, + &aac_unique_id_attr.attr, NULL, }; +ATTRIBUTE_GROUPS(aac_dev); + static int aac_ioctl(struct scsi_device *sdev, unsigned int cmd, void __user *arg) { @@ -1442,21 +1444,23 @@ static struct device_attribute aac_reset = { .show = aac_show_reset_adapter, }; -static struct device_attribute *aac_attrs[] = { - &aac_model, - &aac_vendor, - &aac_flags, - &aac_kernel_version, - &aac_monitor_version, - &aac_bios_version, - &aac_lld_version, - &aac_serial_number, - &aac_max_channel, - &aac_max_id, - &aac_reset, +static struct attribute *aac_host_attrs[] = { + &aac_model.attr, + &aac_vendor.attr, + &aac_flags.attr, + &aac_kernel_version.attr, + &aac_monitor_version.attr, + &aac_bios_version.attr, + &aac_lld_version.attr, + &aac_serial_number.attr, + &aac_max_channel.attr, + &aac_max_id.attr, + &aac_reset.attr, NULL }; +ATTRIBUTE_GROUPS(aac_host); + ssize_t aac_get_serial_number(struct device *device, char *buf) { return aac_show_serial_number(device, &aac_serial_number, buf); @@ -1483,10 +1487,10 @@ static struct scsi_host_template aac_driver_template = { #endif .queuecommand = aac_queuecommand, .bios_param = aac_biosparm, - .shost_attrs = aac_attrs, + .shost_groups = aac_host_groups, .slave_configure = aac_slave_configure, .change_queue_depth = aac_change_queue_depth, - .sdev_attrs = aac_dev_attrs, + .sdev_groups = aac_dev_groups, .eh_abort_handler = aac_eh_abort, .eh_device_reset_handler = aac_eh_dev_reset, .eh_target_reset_handler = aac_eh_target_reset, From patchwork Fri Oct 8 20:23:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546311 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41EB3C433EF for ; Fri, 8 Oct 2021 20:24:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1A29561019 for ; Fri, 8 Oct 2021 20:24:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242391AbhJHU00 (ORCPT ); Fri, 8 Oct 2021 16:26:26 -0400 Received: from mail-pj1-f42.google.com ([209.85.216.42]:51749 "EHLO mail-pj1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232005AbhJHU0Z (ORCPT ); Fri, 8 Oct 2021 16:26:25 -0400 Received: by mail-pj1-f42.google.com with SMTP id kk10so8443803pjb.1 for ; Fri, 08 Oct 2021 13:24:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iGryPJutLwtIW7kiq2LyrJM3XZ6rcHgPyWgYs0NR0VQ=; b=GynD+VkY7tg2OjtTA2bQqWWqnO+KpOtMI+B8pKzAOHTNqBOuKC+TYNbLGe//42hdN3 XnYpnUtyWUO3+oNJRk+BacLb60VWwmGxbd8Ye0IOI7Repna6m/ZEWc+6H/OMX63UEsQK jrkHwiKGzEbv3/hSb+5qiuCNdWGDogjb65hrvLZXeqoXXHnCpNoXisorRrvCu4Ge9L4w nzrPhLV7OTrX8QvKkSoLqv6uOB7UNyeZ/D6TAsrrZn+fdEG6wtE1o6Rmclt9WQYOABxN P5pwahmhUwBQJlyk1fcqAUC9+7yPQLhy6u/XePv9bnRAFQwHRx42rfoN/4ODIVe6uMTu 6Gpw== X-Gm-Message-State: AOAM532Sl7QRCONE6mgQZIhtGmVtbN02TlOefa2nbRiZuxLL0wJ3eoVj f6IMw1S+cagrDeLk6ltnA5U= X-Google-Smtp-Source: ABdhPJxV4Ks5EutkyQxc/DeTw6kM2Q7lk3GPdAjD8/ZNgYkIoOtgTeMtWRdkVwfZMlRm9hmfgPDQQA== X-Received: by 2002:a17:902:930c:b0:13e:42b4:9149 with SMTP id bc12-20020a170902930c00b0013e42b49149mr11206033plb.86.1633724669519; Fri, 08 Oct 2021 13:24:29 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:29 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , "James E.J. Bottomley" , ching Huang , Vaibhav Gupta , Hannes Reinecke , Lee Jones , Kees Cook Subject: [PATCH v3 12/46] scsi: arcmsr: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:19 -0700 Message-Id: <20211008202353.1448570-13-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/arcmsr/arcmsr.h | 2 +- drivers/scsi/arcmsr/arcmsr_attr.c | 33 +++++++++++++++++++------------ drivers/scsi/arcmsr/arcmsr_hba.c | 2 +- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h index 6ce57f031df5..07df255c4b1b 100644 --- a/drivers/scsi/arcmsr/arcmsr.h +++ b/drivers/scsi/arcmsr/arcmsr.h @@ -1041,6 +1041,6 @@ extern uint32_t arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *, struct QBUFFER __iomem *); extern void arcmsr_clear_iop2drv_rqueue_buffer(struct AdapterControlBlock *); extern struct QBUFFER __iomem *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock *); -extern struct device_attribute *arcmsr_host_attrs[]; +extern const struct attribute_group *arcmsr_host_groups[]; extern int arcmsr_alloc_sysfs_attr(struct AdapterControlBlock *); void arcmsr_free_sysfs_attr(struct AdapterControlBlock *acb); diff --git a/drivers/scsi/arcmsr/arcmsr_attr.c b/drivers/scsi/arcmsr/arcmsr_attr.c index 57be9609d504..baeb5e795690 100644 --- a/drivers/scsi/arcmsr/arcmsr_attr.c +++ b/drivers/scsi/arcmsr/arcmsr_attr.c @@ -58,8 +58,6 @@ #include #include "arcmsr.h" -struct device_attribute *arcmsr_host_attrs[]; - static ssize_t arcmsr_sysfs_iop_message_read(struct file *filp, struct kobject *kobj, struct bin_attribute *bin, @@ -389,16 +387,25 @@ static DEVICE_ATTR(host_fw_numbers_queue, S_IRUGO, arcmsr_attr_host_fw_numbers_q static DEVICE_ATTR(host_fw_sdram_size, S_IRUGO, arcmsr_attr_host_fw_sdram_size, NULL); static DEVICE_ATTR(host_fw_hd_channels, S_IRUGO, arcmsr_attr_host_fw_hd_channels, NULL); -struct device_attribute *arcmsr_host_attrs[] = { - &dev_attr_host_driver_version, - &dev_attr_host_driver_posted_cmd, - &dev_attr_host_driver_reset, - &dev_attr_host_driver_abort, - &dev_attr_host_fw_model, - &dev_attr_host_fw_version, - &dev_attr_host_fw_request_len, - &dev_attr_host_fw_numbers_queue, - &dev_attr_host_fw_sdram_size, - &dev_attr_host_fw_hd_channels, +static struct attribute *arcmsr_host_attrs[] = { + &dev_attr_host_driver_version.attr, + &dev_attr_host_driver_posted_cmd.attr, + &dev_attr_host_driver_reset.attr, + &dev_attr_host_driver_abort.attr, + &dev_attr_host_fw_model.attr, + &dev_attr_host_fw_version.attr, + &dev_attr_host_fw_request_len.attr, + &dev_attr_host_fw_numbers_queue.attr, + &dev_attr_host_fw_sdram_size.attr, + &dev_attr_host_fw_hd_channels.attr, NULL, }; + +static const struct attribute_group arcmsr_host_attr_group = { + .attrs = arcmsr_host_attrs, +}; + +const struct attribute_group *arcmsr_host_groups[] = { + &arcmsr_host_attr_group, + NULL +}; diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c index ec1a834c922d..a2d7de96ff2b 100644 --- a/drivers/scsi/arcmsr/arcmsr_hba.c +++ b/drivers/scsi/arcmsr/arcmsr_hba.c @@ -167,7 +167,7 @@ static struct scsi_host_template arcmsr_scsi_host_template = { .sg_tablesize = ARCMSR_DEFAULT_SG_ENTRIES, .max_sectors = ARCMSR_MAX_XFER_SECTORS_C, .cmd_per_lun = ARCMSR_DEFAULT_CMD_PERLUN, - .shost_attrs = arcmsr_host_attrs, + .shost_groups = arcmsr_host_groups, .no_write_same = 1, }; From patchwork Fri Oct 8 20:23:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546313 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3333FC433EF for ; Fri, 8 Oct 2021 20:24:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1958661019 for ; Fri, 8 Oct 2021 20:24:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242286AbhJHU0a (ORCPT ); Fri, 8 Oct 2021 16:26:30 -0400 Received: from mail-pf1-f171.google.com ([209.85.210.171]:44645 "EHLO mail-pf1-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232005AbhJHU01 (ORCPT ); Fri, 8 Oct 2021 16:26:27 -0400 Received: by mail-pf1-f171.google.com with SMTP id 145so9085732pfz.11 for ; Fri, 08 Oct 2021 13:24:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0oytqwBYbr35Z6MtPz7HCBDp8jm+jqZ/k5dsTUcnRlA=; b=1kxnpsTd2MwRoJur35+bvpgPmGKdu+CQB3aFcSWefPD6ptZh7fVv2N1eMxo/lnvDM8 jnwcmpH8+Yfbml53BR80/YygK4n/wBOfrk6Q0inoG114koxutExwtM7Fkzhs9NthSa+j fsv2/LwnqEyU4yOFOgubaBe+jHQigbF6bjRr/ObFwIyRR04hz0YC5udDaJiVGQrwChBD zAaa9JpGfFeAV/HrT6cbYUR43T6k9PPQVfTMj61XAakhShVrZ3zsmx3r59f1ropDhvfy QJv5/ETI+J2wGsxNDeaCAnLAeVz4O5lHedEw3gfLhrOBWLSltDbI/kaO+uRS59SPtLpK 8CZA== X-Gm-Message-State: AOAM533NyHcNrnKepFczYu15afKPynPv4pjqeMSMdVsgfeUAXqXxLqRL uRZpD4qUN2wkz9Q6VhIziTLAaEnwP4xFUA== X-Google-Smtp-Source: ABdhPJzksCOY0cFJ4B61tYcZl1It5AyMIuAl780fcK5MY7zbc74X0ZKEwYrIBXQuDbkXiaxOo6RUCw== X-Received: by 2002:a63:9d4c:: with SMTP id i73mr6367607pgd.216.1633724670901; Fri, 08 Oct 2021 13:24:30 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:30 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Ketan Mukadam , "James E.J. Bottomley" Subject: [PATCH v3 13/46] scsi: be2iscsi: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:20 -0700 Message-Id: <20211008202353.1448570-14-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/be2iscsi/be_main.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index e70f69f791db..ab55681145f8 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c @@ -163,17 +163,20 @@ DEVICE_ATTR(beiscsi_active_session_count, S_IRUGO, beiscsi_active_session_disp, NULL); DEVICE_ATTR(beiscsi_free_session_count, S_IRUGO, beiscsi_free_session_disp, NULL); -static struct device_attribute *beiscsi_attrs[] = { - &dev_attr_beiscsi_log_enable, - &dev_attr_beiscsi_drvr_ver, - &dev_attr_beiscsi_adapter_family, - &dev_attr_beiscsi_fw_ver, - &dev_attr_beiscsi_active_session_count, - &dev_attr_beiscsi_free_session_count, - &dev_attr_beiscsi_phys_port, + +static struct attribute *beiscsi_attrs[] = { + &dev_attr_beiscsi_log_enable.attr, + &dev_attr_beiscsi_drvr_ver.attr, + &dev_attr_beiscsi_adapter_family.attr, + &dev_attr_beiscsi_fw_ver.attr, + &dev_attr_beiscsi_active_session_count.attr, + &dev_attr_beiscsi_free_session_count.attr, + &dev_attr_beiscsi_phys_port.attr, NULL, }; +ATTRIBUTE_GROUPS(beiscsi); + static char const *cqe_desc[] = { "RESERVED_DESC", "SOL_CMD_COMPLETE", @@ -391,7 +394,7 @@ static struct scsi_host_template beiscsi_sht = { .eh_abort_handler = beiscsi_eh_abort, .eh_device_reset_handler = beiscsi_eh_device_reset, .eh_target_reset_handler = iscsi_eh_session_reset, - .shost_attrs = beiscsi_attrs, + .shost_groups = beiscsi_groups, .sg_tablesize = BEISCSI_SGLIST_ELEMENTS, .can_queue = BE2_IO_DEPTH, .this_id = -1, From patchwork Fri Oct 8 20:23:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546315 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF57BC433F5 for ; Fri, 8 Oct 2021 20:24:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF12F610E7 for ; Fri, 8 Oct 2021 20:24:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242410AbhJHU0b (ORCPT ); Fri, 8 Oct 2021 16:26:31 -0400 Received: from mail-pj1-f50.google.com ([209.85.216.50]:55219 "EHLO mail-pj1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232119AbhJHU03 (ORCPT ); Fri, 8 Oct 2021 16:26:29 -0400 Received: by mail-pj1-f50.google.com with SMTP id np13so8412721pjb.4 for ; Fri, 08 Oct 2021 13:24:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=h978B1xPZVs8EBEqkQJzccy7GM6g4uoYqAZnY/bH15M=; b=Aa3Z/w0b9Q8dnjnv0fmerO75dS/U9b7Avr1lsi71e53hthANVCNi8OM2q0mKwv0A3a F43ULjGHKJyNSUMxZeFQUAYOTSbWzwL0/S3QQnHeeS7ulkUZuz3RDnOmHIdK6g7AY3fS qI5TtXhFqWWlJWR5twypR1sOstRHgBCWx0nynuY8OLj0w2bIh3gRlDUZl373SQzz15u6 h6ikWt/COg5ie9ms1V8uiKrGKtPt4Ay8OGH8tFPMA/zlMBEmM6uunnAQsAn/D447zXMW pnfnnIiEFgqBhc+59rJ8a/T4BKda//TL8uzcRZN36oZfhSLDPv4buC7RQKzlGveVNk5J rZCA== X-Gm-Message-State: AOAM531oYdMd3TjLmd52+HZ+eqGazfIe5KldtHl82uiuZo3us+8we+BZ /6EwaKvzia8Fz1QpmJxSncs= X-Google-Smtp-Source: ABdhPJzTRQwEnbD9Zoy7KcrKtinizVwFgCI0VjS7ifR2W73346GP7VrJJBiyss6MDG08RZy0VTDR0g== X-Received: by 2002:a17:902:eccf:b0:13e:b002:d8bd with SMTP id a15-20020a170902eccf00b0013eb002d8bdmr11452319plh.48.1633724672447; Fri, 08 Oct 2021 13:24:32 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:31 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Anil Gurumurthy , Sudarsana Kalluru , "James E.J. Bottomley" Subject: [PATCH v3 14/46] scsi: bfa: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:21 -0700 Message-Id: <20211008202353.1448570-15-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/bfa/bfad_attr.c | 68 ++++++++++++++++++++++-------------- drivers/scsi/bfa/bfad_im.c | 4 +-- drivers/scsi/bfa/bfad_im.h | 4 +-- 3 files changed, 46 insertions(+), 30 deletions(-) diff --git a/drivers/scsi/bfa/bfad_attr.c b/drivers/scsi/bfa/bfad_attr.c index 5ae1e3f78910..c8b947c16069 100644 --- a/drivers/scsi/bfa/bfad_attr.c +++ b/drivers/scsi/bfa/bfad_attr.c @@ -956,36 +956,52 @@ static DEVICE_ATTR(driver_name, S_IRUGO, bfad_im_drv_name_show, NULL); static DEVICE_ATTR(number_of_discovered_ports, S_IRUGO, bfad_im_num_of_discovered_ports_show, NULL); -struct device_attribute *bfad_im_host_attrs[] = { - &dev_attr_serial_number, - &dev_attr_model, - &dev_attr_model_description, - &dev_attr_node_name, - &dev_attr_symbolic_name, - &dev_attr_hardware_version, - &dev_attr_driver_version, - &dev_attr_option_rom_version, - &dev_attr_firmware_version, - &dev_attr_number_of_ports, - &dev_attr_driver_name, - &dev_attr_number_of_discovered_ports, +static struct attribute *bfad_im_host_attrs[] = { + &dev_attr_serial_number.attr, + &dev_attr_model.attr, + &dev_attr_model_description.attr, + &dev_attr_node_name.attr, + &dev_attr_symbolic_name.attr, + &dev_attr_hardware_version.attr, + &dev_attr_driver_version.attr, + &dev_attr_option_rom_version.attr, + &dev_attr_firmware_version.attr, + &dev_attr_number_of_ports.attr, + &dev_attr_driver_name.attr, + &dev_attr_number_of_discovered_ports.attr, NULL, }; -struct device_attribute *bfad_im_vport_attrs[] = { - &dev_attr_serial_number, - &dev_attr_model, - &dev_attr_model_description, - &dev_attr_node_name, - &dev_attr_symbolic_name, - &dev_attr_hardware_version, - &dev_attr_driver_version, - &dev_attr_option_rom_version, - &dev_attr_firmware_version, - &dev_attr_number_of_ports, - &dev_attr_driver_name, - &dev_attr_number_of_discovered_ports, +static const struct attribute_group bfad_im_host_attr_group = { + .attrs = bfad_im_host_attrs +}; + +const struct attribute_group *bfad_im_host_groups[] = { + &bfad_im_host_attr_group, + NULL +}; + +struct attribute *bfad_im_vport_attrs[] = { + &dev_attr_serial_number.attr, + &dev_attr_model.attr, + &dev_attr_model_description.attr, + &dev_attr_node_name.attr, + &dev_attr_symbolic_name.attr, + &dev_attr_hardware_version.attr, + &dev_attr_driver_version.attr, + &dev_attr_option_rom_version.attr, + &dev_attr_firmware_version.attr, + &dev_attr_number_of_ports.attr, + &dev_attr_driver_name.attr, + &dev_attr_number_of_discovered_ports.attr, NULL, }; +static const struct attribute_group bfad_im_vport_attr_group = { + .attrs = bfad_im_vport_attrs +}; +const struct attribute_group *bfad_im_vport_groups[] = { + &bfad_im_vport_attr_group, + NULL +}; diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c index 6b5841b1c06e..c074088afe12 100644 --- a/drivers/scsi/bfa/bfad_im.c +++ b/drivers/scsi/bfa/bfad_im.c @@ -809,7 +809,7 @@ struct scsi_host_template bfad_im_scsi_host_template = { .this_id = -1, .sg_tablesize = BFAD_IO_MAX_SGE, .cmd_per_lun = 3, - .shost_attrs = bfad_im_host_attrs, + .shost_groups = bfad_im_host_groups, .max_sectors = BFAD_MAX_SECTORS, .vendor_id = BFA_PCI_VENDOR_ID_BROCADE, }; @@ -831,7 +831,7 @@ struct scsi_host_template bfad_im_vport_template = { .this_id = -1, .sg_tablesize = BFAD_IO_MAX_SGE, .cmd_per_lun = 3, - .shost_attrs = bfad_im_vport_attrs, + .shost_groups = bfad_im_vport_groups, .max_sectors = BFAD_MAX_SECTORS, }; diff --git a/drivers/scsi/bfa/bfad_im.h b/drivers/scsi/bfa/bfad_im.h index f16d4b219e44..829345b514d1 100644 --- a/drivers/scsi/bfa/bfad_im.h +++ b/drivers/scsi/bfa/bfad_im.h @@ -174,8 +174,8 @@ extern struct fc_function_template bfad_im_vport_fc_function_template; extern struct scsi_transport_template *bfad_im_scsi_transport_template; extern struct scsi_transport_template *bfad_im_scsi_vport_transport_template; -extern struct device_attribute *bfad_im_host_attrs[]; -extern struct device_attribute *bfad_im_vport_attrs[]; +extern const struct attribute_group *bfad_im_host_groups[]; +extern const struct attribute_group *bfad_im_vport_groups[]; irqreturn_t bfad_intx(int irq, void *dev_id); From patchwork Fri Oct 8 20:23:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546319 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37389C433FE for ; Fri, 8 Oct 2021 20:24:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 21C9C61073 for ; Fri, 8 Oct 2021 20:24:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242443AbhJHU0c (ORCPT ); Fri, 8 Oct 2021 16:26:32 -0400 Received: from mail-pg1-f177.google.com ([209.85.215.177]:36756 "EHLO mail-pg1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242508AbhJHU03 (ORCPT ); Fri, 8 Oct 2021 16:26:29 -0400 Received: by mail-pg1-f177.google.com with SMTP id 75so4165780pga.3 for ; Fri, 08 Oct 2021 13:24:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zdPWTIvQItNpTqfQHoMSC0Y/0kKay1uG25Wzw8miLo0=; b=a4vKR7Izhv97QvKwekrH6jKUxto7DbPIR8YSpBc1c6A+3GKEkvhQvPQbvZsT8LV4om 1v/SksoOtgRTx2UCEgG3TDSCQZSHE72KOhS+3xgu4N9wATy0xmADPaCQpVGswquEJCwf TZP++eelDijkihfdxiilEqFyK80MDy2MlzhaUD7qqWd8yej/E/pFkpdQcZ9d8oYWzwsc 48aIZG9235LkISmw8xPQCQPXiyYBy/Spy12jiHAt3JLicS75m5nodJZv/YNBnDkUT982 8K9WOLKLkl/NoBTUTR48rCV8OcUb5Dd48Sz+xPCw+qKbyzIwcxFMVt7O45Sdv3fpe46U KdxA== X-Gm-Message-State: AOAM5338SFOXWUxuoMl3T1XeamYo/TNvxtktcHa16+/3ESe8j+3Ql9FF 5vIgvXQkzMogV7csiaZfTGA= X-Google-Smtp-Source: ABdhPJwFJJUoiRgsFW3D9tNHF0x1IE18/pxcrCxKNdpNjLHGNTpyvvswuaSujRFrzAeWnYyaPvBG+A== X-Received: by 2002:a05:6a00:26f7:b0:44c:7695:bfba with SMTP id p55-20020a056a0026f700b0044c7695bfbamr11965875pfw.12.1633724673917; Fri, 08 Oct 2021 13:24:33 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:33 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Saurav Kashyap , Javed Hasan , GR-QLogic-Storage-Upstream@marvell.com, "James E.J. Bottomley" Subject: [PATCH v3 15/46] scsi: bnx2fc: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:22 -0700 Message-Id: <20211008202353.1448570-16-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index 8863a74e6c57..71fa62bd3083 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c @@ -2951,11 +2951,13 @@ bnx2fc_tm_timeout_store(struct device *dev, static DEVICE_ATTR(tm_timeout, S_IRUGO|S_IWUSR, bnx2fc_tm_timeout_show, bnx2fc_tm_timeout_store); -static struct device_attribute *bnx2fc_host_attrs[] = { - &dev_attr_tm_timeout, +static struct attribute *bnx2fc_host_attrs[] = { + &dev_attr_tm_timeout.attr, NULL, }; +ATTRIBUTE_GROUPS(bnx2fc_host); + /* * scsi_host_template structure used while registering with SCSI-ml */ @@ -2977,7 +2979,7 @@ static struct scsi_host_template bnx2fc_shost_template = { .max_sectors = 0x3fbf, .track_queue_depth = 1, .slave_configure = bnx2fc_slave_configure, - .shost_attrs = bnx2fc_host_attrs, + .shost_groups = bnx2fc_host_groups, }; static struct libfc_function_template bnx2fc_libfc_fcn_templ = { From patchwork Fri Oct 8 20:23:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546317 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA194C4332F for ; Fri, 8 Oct 2021 20:24:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A6520610E7 for ; Fri, 8 Oct 2021 20:24:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242570AbhJHU0c (ORCPT ); Fri, 8 Oct 2021 16:26:32 -0400 Received: from mail-pg1-f182.google.com ([209.85.215.182]:40630 "EHLO mail-pg1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242595AbhJHU0b (ORCPT ); Fri, 8 Oct 2021 16:26:31 -0400 Received: by mail-pg1-f182.google.com with SMTP id h3so4156683pgb.7 for ; Fri, 08 Oct 2021 13:24:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6xpdXRUZrHa2dh7OhsosMe9PUV3PZXzVX6aPTtYLzwQ=; b=HXLM5JE2JThJJzVNpKpOpj6E8zNDcVvaTxLLrlAED+JwFwo45kegT35Kb0LnhvBPD6 jnkoiN0znZ5K7UDOCvIFHeg5PeqtPAawtv8q/VBdR7kgGQLVJDnT49QOPb02KxkI1Klw ufbe6lKD5D2zCmzCzDHEwUasFfZSh1sRAZjhDKbHLhAVpSuLhgZpM7A1bjrxh+cBErFK CptZqkMOM8nyXIio0jZKj/Z7u1j2t0PkFnUogJbgEVksXJJ18FmKeJZwZSG4OUWM2wTD QXMFN7+46cfSUVHUtJh5YacOkIcEEafgwaIHvg6KwtEGUMxMBHdm49UiT1c4dzvpXh1k 8Bqg== X-Gm-Message-State: AOAM532KjJvYJvCPTMeBIXjtMl/3f9B3QpEO4rF4tkPYbNVZTWsNPIke G6SuQakA1hEEr33UARhiTmo= X-Google-Smtp-Source: ABdhPJxxByIwDhulHecrGUJHq4wkMGet15+BANrrPrE752G21Z3aHl2Pgk6RF9uVL622+1J7pRd0Cg== X-Received: by 2002:a63:d64c:: with SMTP id d12mr6517910pgj.186.1633724675452; Fri, 08 Oct 2021 13:24:35 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:34 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Nilesh Javali , Manish Rangankar , GR-QLogic-Storage-Upstream@marvell.com, "James E.J. Bottomley" Subject: [PATCH v3 16/46] scsi: bnx2i: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:23 -0700 Message-Id: <20211008202353.1448570-17-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/bnx2i/bnx2i.h | 2 +- drivers/scsi/bnx2i/bnx2i_iscsi.c | 2 +- drivers/scsi/bnx2i/bnx2i_sysfs.c | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/bnx2i/bnx2i.h b/drivers/scsi/bnx2i/bnx2i.h index 663a63d4dae4..df7d04afce05 100644 --- a/drivers/scsi/bnx2i/bnx2i.h +++ b/drivers/scsi/bnx2i/bnx2i.h @@ -795,7 +795,7 @@ extern struct cnic_ulp_ops bnx2i_cnic_cb; extern unsigned int sq_size; extern unsigned int rq_size; -extern struct device_attribute *bnx2i_dev_attributes[]; +extern const struct attribute_group *bnx2i_dev_groups[]; diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c index 1b5f3e143f07..e21b053b4f3e 100644 --- a/drivers/scsi/bnx2i/bnx2i_iscsi.c +++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c @@ -2266,7 +2266,7 @@ static struct scsi_host_template bnx2i_host_template = { .cmd_per_lun = 128, .this_id = -1, .sg_tablesize = ISCSI_MAX_BDS_PER_CMD, - .shost_attrs = bnx2i_dev_attributes, + .shost_groups = bnx2i_dev_groups, .track_queue_depth = 1, }; diff --git a/drivers/scsi/bnx2i/bnx2i_sysfs.c b/drivers/scsi/bnx2i/bnx2i_sysfs.c index bea00073cb7c..d6b0bbb5176b 100644 --- a/drivers/scsi/bnx2i/bnx2i_sysfs.c +++ b/drivers/scsi/bnx2i/bnx2i_sysfs.c @@ -142,8 +142,17 @@ static DEVICE_ATTR(sq_size, S_IRUGO | S_IWUSR, static DEVICE_ATTR(num_ccell, S_IRUGO | S_IWUSR, bnx2i_show_ccell_info, bnx2i_set_ccell_info); -struct device_attribute *bnx2i_dev_attributes[] = { - &dev_attr_sq_size, - &dev_attr_num_ccell, +static struct attribute *bnx2i_dev_attributes[] = { + &dev_attr_sq_size.attr, + &dev_attr_num_ccell.attr, + NULL +}; + +static const struct attribute_group bnx2i_dev_attr_group = { + .attrs = bnx2i_dev_attributes +}; + +const struct attribute_group *bnx2i_dev_groups[] = { + &bnx2i_dev_attr_group, NULL }; From patchwork Fri Oct 8 20:23:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546321 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 466F1C433EF for ; Fri, 8 Oct 2021 20:24:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 322386112D for ; Fri, 8 Oct 2021 20:24:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242623AbhJHU0g (ORCPT ); Fri, 8 Oct 2021 16:26:36 -0400 Received: from mail-pl1-f174.google.com ([209.85.214.174]:44842 "EHLO mail-pl1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242591AbhJHU0f (ORCPT ); Fri, 8 Oct 2021 16:26:35 -0400 Received: by mail-pl1-f174.google.com with SMTP id t11so6837313plq.11 for ; Fri, 08 Oct 2021 13:24:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vM4jbQskNaFDXzTVQqQG1k37VqAHDN3vzlXEf6ehPR8=; b=avNhTdgSHEVLU14ZgUZoFyICzVaeGoyoDObF4cWlRA49gSCaVDgQ1Hk57Iv1IvP58W mv6x65SGM6xpU5v7QdAGgW9ic7Ih53n4Q7+uXyo4fmuP/hSO+241HjJ4Yzl1ocWxEPoN fMNlo8jf7d1QrpGZBSiN1gsOtoEclrMZa0zXEGPKiRfty5deoXQfZnSi75lxA/XrJbl6 SmYWClRaOQ9yXJpWaJBAAwCEixeZrV651MvWQ9D8PvisOWdM2ZMm5cWiY4+Ehrwj3o7u AaLHnkpeAYA/hiT5HCSblqtzWzHP5UyFdZJooEVV+usFlE1h3vhZFsQVBSzYiwNJ3rkv LsFg== X-Gm-Message-State: AOAM531a59NmlKBmsPzkSPT0HayFRp68rvPsCVAxtc4yQDcEUCSyZw/v SnsP9bKopYFZvHDQLM57PpA= X-Google-Smtp-Source: ABdhPJztviwLe4kPyLpr/OVCRZOWHt7hEVAaJih7pzWDM5TYv0y8NWPqJ75pFiC7krt1xkM5+Zjwgg== X-Received: by 2002:a17:902:6f01:b0:13b:7b8b:84a3 with SMTP id w1-20020a1709026f0100b0013b7b8b84a3mr11180054plk.40.1633724679747; Fri, 08 Oct 2021 13:24:39 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:39 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , "James E.J. Bottomley" , Jiapeng Chong Subject: [PATCH v3 17/46] scsi: csiostor: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:24 -0700 Message-Id: <20211008202353.1448570-18-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/csiostor/csio_scsi.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/csiostor/csio_scsi.c b/drivers/scsi/csiostor/csio_scsi.c index 3b2eb6ce1fcf..bcfae3859f4c 100644 --- a/drivers/scsi/csiostor/csio_scsi.c +++ b/drivers/scsi/csiostor/csio_scsi.c @@ -1460,14 +1460,16 @@ static DEVICE_ATTR(disable_port, S_IWUSR, NULL, csio_disable_port); static DEVICE_ATTR(dbg_level, S_IRUGO | S_IWUSR, csio_show_dbg_level, csio_store_dbg_level); -static struct device_attribute *csio_fcoe_lport_attrs[] = { - &dev_attr_hw_state, - &dev_attr_device_reset, - &dev_attr_disable_port, - &dev_attr_dbg_level, +static struct attribute *csio_fcoe_lport_attrs[] = { + &dev_attr_hw_state.attr, + &dev_attr_device_reset.attr, + &dev_attr_disable_port.attr, + &dev_attr_dbg_level.attr, NULL, }; +ATTRIBUTE_GROUPS(csio_fcoe_lport); + static ssize_t csio_show_num_reg_rnodes(struct device *dev, struct device_attribute *attr, char *buf) @@ -1479,12 +1481,14 @@ csio_show_num_reg_rnodes(struct device *dev, static DEVICE_ATTR(num_reg_rnodes, S_IRUGO, csio_show_num_reg_rnodes, NULL); -static struct device_attribute *csio_fcoe_vport_attrs[] = { - &dev_attr_num_reg_rnodes, - &dev_attr_dbg_level, +static struct attribute *csio_fcoe_vport_attrs[] = { + &dev_attr_num_reg_rnodes.attr, + &dev_attr_dbg_level.attr, NULL, }; +ATTRIBUTE_GROUPS(csio_fcoe_vport); + static inline uint32_t csio_scsi_copy_to_sgl(struct csio_hw *hw, struct csio_ioreq *req) { @@ -2277,7 +2281,7 @@ struct scsi_host_template csio_fcoe_shost_template = { .this_id = -1, .sg_tablesize = CSIO_SCSI_MAX_SGE, .cmd_per_lun = CSIO_MAX_CMD_PER_LUN, - .shost_attrs = csio_fcoe_lport_attrs, + .shost_groups = csio_fcoe_lport_groups, .max_sectors = CSIO_MAX_SECTOR_SIZE, }; @@ -2296,7 +2300,7 @@ struct scsi_host_template csio_fcoe_shost_vport_template = { .this_id = -1, .sg_tablesize = CSIO_SCSI_MAX_SGE, .cmd_per_lun = CSIO_MAX_CMD_PER_LUN, - .shost_attrs = csio_fcoe_vport_attrs, + .shost_groups = csio_fcoe_vport_groups, .max_sectors = CSIO_MAX_SECTOR_SIZE, }; From patchwork Fri Oct 8 20:23:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546323 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF52FC433FE for ; Fri, 8 Oct 2021 20:24:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B9CCD610E7 for ; Fri, 8 Oct 2021 20:24:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242635AbhJHU0h (ORCPT ); Fri, 8 Oct 2021 16:26:37 -0400 Received: from mail-pf1-f175.google.com ([209.85.210.175]:43797 "EHLO mail-pf1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232091AbhJHU0h (ORCPT ); Fri, 8 Oct 2021 16:26:37 -0400 Received: by mail-pf1-f175.google.com with SMTP id 187so9093330pfc.10 for ; Fri, 08 Oct 2021 13:24:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=I0c+nV8p2rT/HmjUOeDz34YoCK9/gAs2RcO0O3Za1pc=; b=RYDKrDO5QGgScTTKL0dxRjov78/2Fk2weC82urkvjrF6zvLUS4LifSBM3jCNE5oNPs wlX/iWwAenL7l57aCXXyNchBjuc2Q5p1g34rjBO2Fbsh5GnFCnn1WnRhoL0p2h9JKO8O AFqs+2kyssXL91KJwQOSJEq87cLiVuGrslWbafVhviz7QIxoQscKV9beTOgaV8uBM/vB wO93bfZLGJ15kvWaMBZ6ah6Ei0iJlqrmGLFuixs/ZsA1sHt1/UlkkuJBRYmEcScod2Df GiWe8g88JGsKOXfYsaHPWu1LQsaBeKnlwp/md6XFHpi4y1HcvVMHo0g2YpszLDHCZhpf jMKA== X-Gm-Message-State: AOAM533JLaS2TlYoIGL3EV3K81NkpNDF05qH2112RIZ105M1w88/mKVW v3OFP23NiSjdRMgQtHXzLgw= X-Google-Smtp-Source: ABdhPJwfcUCYkUvqgq9ZlVSrUpAv9h3s6aDSrQ23U1lAW5wd3EdGV0rYSk0NkOyEq9SOqscaTpIYUw== X-Received: by 2002:a63:7b48:: with SMTP id k8mr4208487pgn.208.1633724681186; Fri, 08 Oct 2021 13:24:41 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:40 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , "Matthew R. Ochs" , Uma Krishnan , "James E.J. Bottomley" Subject: [PATCH v3 18/46] scsi: cxlflash: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:25 -0700 Message-Id: <20211008202353.1448570-19-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/cxlflash/main.c | 40 ++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c index b2730e859df8..0c806dc95e89 100644 --- a/drivers/scsi/cxlflash/main.c +++ b/drivers/scsi/cxlflash/main.c @@ -3103,33 +3103,37 @@ static DEVICE_ATTR_RW(irqpoll_weight); static DEVICE_ATTR_RW(num_hwqs); static DEVICE_ATTR_RW(hwq_mode); -static struct device_attribute *cxlflash_host_attrs[] = { - &dev_attr_port0, - &dev_attr_port1, - &dev_attr_port2, - &dev_attr_port3, - &dev_attr_lun_mode, - &dev_attr_ioctl_version, - &dev_attr_port0_lun_table, - &dev_attr_port1_lun_table, - &dev_attr_port2_lun_table, - &dev_attr_port3_lun_table, - &dev_attr_irqpoll_weight, - &dev_attr_num_hwqs, - &dev_attr_hwq_mode, +static struct attribute *cxlflash_host_attrs[] = { + &dev_attr_port0.attr, + &dev_attr_port1.attr, + &dev_attr_port2.attr, + &dev_attr_port3.attr, + &dev_attr_lun_mode.attr, + &dev_attr_ioctl_version.attr, + &dev_attr_port0_lun_table.attr, + &dev_attr_port1_lun_table.attr, + &dev_attr_port2_lun_table.attr, + &dev_attr_port3_lun_table.attr, + &dev_attr_irqpoll_weight.attr, + &dev_attr_num_hwqs.attr, + &dev_attr_hwq_mode.attr, NULL }; +ATTRIBUTE_GROUPS(cxlflash_host); + /* * Device attributes */ static DEVICE_ATTR_RO(mode); -static struct device_attribute *cxlflash_dev_attrs[] = { - &dev_attr_mode, +static struct attribute *cxlflash_dev_attrs[] = { + &dev_attr_mode.attr, NULL }; +ATTRIBUTE_GROUPS(cxlflash_dev); + /* * Host template */ @@ -3150,8 +3154,8 @@ static struct scsi_host_template driver_template = { .this_id = -1, .sg_tablesize = 1, /* No scatter gather support */ .max_sectors = CXLFLASH_MAX_SECTORS, - .shost_attrs = cxlflash_host_attrs, - .sdev_attrs = cxlflash_dev_attrs, + .shost_groups = cxlflash_host_groups, + .sdev_groups = cxlflash_dev_groups, }; /* From patchwork Fri Oct 8 20:23:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546325 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14ADCC433F5 for ; Fri, 8 Oct 2021 20:24:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F17E7610E7 for ; Fri, 8 Oct 2021 20:24:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232110AbhJHU0j (ORCPT ); Fri, 8 Oct 2021 16:26:39 -0400 Received: from mail-pj1-f48.google.com ([209.85.216.48]:34398 "EHLO mail-pj1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242650AbhJHU0i (ORCPT ); Fri, 8 Oct 2021 16:26:38 -0400 Received: by mail-pj1-f48.google.com with SMTP id q7-20020a17090a2e0700b001a01027dd88so6321086pjd.1 for ; Fri, 08 Oct 2021 13:24:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yKgFQ4b5+xlIZpN+tyS/Y7wNncIIGGAO+CjlSX8yfv4=; b=6pVJ5iWRY6JZ91kM9awpVyDmsyrietxP+2hWLagwJuhI75zoymnT+Zuk5v94nmnSuU N8l5V5whVB71tenQ6scOYmvkCS7kHdiAR5ScM+jTgP8ZEradwPXoMjqwQlw6H/bQrUNJ RGKIzBSME/pMpnEYvLuPV3lUmkwwHbmG31RfemIdsUOwbR6IY8CK9/66BqHVsestd9s9 U8HHHZHBEPGaOHOesMiDbwRMNfylm3nx/xZOI2Wc0yWKq7QZ4v8tmoc8BLj7EDfSXVK8 vBjdBROfY93I+1++KpiqXVabqmbMCa5fiZhBMZbBnpOtroyjen8bWOiIw4B8whHTpza2 BrqQ== X-Gm-Message-State: AOAM5323/N463Pg75AsR2oAgSmAPtWOExpWLu/Nyy3ngIVtqJY2b7rFI JuiaxTFXKZsJv+bdTj72Tn8= X-Google-Smtp-Source: ABdhPJzSUiJ4NeOF1sFeSfUrtioEcinSfLPW01WbARjRJPS1Oo8Gh4pADxA9LLBAOY80PmPFhWg5/g== X-Received: by 2002:a17:902:9684:b0:13e:32cb:c95d with SMTP id n4-20020a170902968400b0013e32cbc95dmr11359179plp.31.1633724682743; Fri, 08 Oct 2021 13:24:42 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:42 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Satish Kharat , Sesidhar Baddela , Karan Tilak Kumar , "James E.J. Bottomley" Subject: [PATCH v3 19/46] scsi: fnic: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:26 -0700 Message-Id: <20211008202353.1448570-20-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/fnic/fnic.h | 2 +- drivers/scsi/fnic/fnic_attrs.c | 17 +++++++++++++---- drivers/scsi/fnic/fnic_main.c | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/fnic/fnic.h b/drivers/scsi/fnic/fnic.h index 69f373b53132..b95d0063dedb 100644 --- a/drivers/scsi/fnic/fnic.h +++ b/drivers/scsi/fnic/fnic.h @@ -322,7 +322,7 @@ static inline struct fnic *fnic_from_ctlr(struct fcoe_ctlr *fip) extern struct workqueue_struct *fnic_event_queue; extern struct workqueue_struct *fnic_fip_queue; -extern struct device_attribute *fnic_attrs[]; +extern const struct attribute_group *fnic_host_groups[]; void fnic_clear_intr_mode(struct fnic *fnic); int fnic_set_intr_mode(struct fnic *fnic); diff --git a/drivers/scsi/fnic/fnic_attrs.c b/drivers/scsi/fnic/fnic_attrs.c index aea0c3becfd4..bbe2ca4971b2 100644 --- a/drivers/scsi/fnic/fnic_attrs.c +++ b/drivers/scsi/fnic/fnic_attrs.c @@ -48,9 +48,18 @@ static DEVICE_ATTR(fnic_state, S_IRUGO, fnic_show_state, NULL); static DEVICE_ATTR(drv_version, S_IRUGO, fnic_show_drv_version, NULL); static DEVICE_ATTR(link_state, S_IRUGO, fnic_show_link_state, NULL); -struct device_attribute *fnic_attrs[] = { - &dev_attr_fnic_state, - &dev_attr_drv_version, - &dev_attr_link_state, +static struct attribute *fnic_host_attrs[] = { + &dev_attr_fnic_state.attr, + &dev_attr_drv_version.attr, + &dev_attr_link_state.attr, NULL, }; + +static const struct attribute_group fnic_host_attr_group = { + .attrs = fnic_host_attrs +}; + +const struct attribute_group *fnic_host_groups[] = { + &fnic_host_attr_group, + NULL +}; diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c index 786f9d2704b6..44dbaa662d94 100644 --- a/drivers/scsi/fnic/fnic_main.c +++ b/drivers/scsi/fnic/fnic_main.c @@ -122,7 +122,7 @@ static struct scsi_host_template fnic_host_template = { .can_queue = FNIC_DFLT_IO_REQ, .sg_tablesize = FNIC_MAX_SG_DESC_CNT, .max_sectors = 0xffff, - .shost_attrs = fnic_attrs, + .shost_groups = fnic_host_groups, .track_queue_depth = 1, }; From patchwork Fri Oct 8 20:23:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546327 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3728C433FE for ; Fri, 8 Oct 2021 20:24:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8A5D261019 for ; Fri, 8 Oct 2021 20:24:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242687AbhJHU0k (ORCPT ); Fri, 8 Oct 2021 16:26:40 -0400 Received: from mail-pj1-f44.google.com ([209.85.216.44]:36521 "EHLO mail-pj1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242391AbhJHU0k (ORCPT ); Fri, 8 Oct 2021 16:26:40 -0400 Received: by mail-pj1-f44.google.com with SMTP id qe4-20020a17090b4f8400b0019f663cfcd1so10167004pjb.1 for ; Fri, 08 Oct 2021 13:24:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7fS3vfVjSUAQtncOlTU0F2ED99R9H0HV+z+Q4ZYAT9k=; b=de42n7AtqHTiCWY4Fc/CpR73ZOjqjeFfmxHkqYn82xhV/w/BDzxON6/4JMT7uHUlxR zj9NBOGFQX31funCejQ0L4GXhzbc72C28LTTUeOnTz/ZQn3Zrc1ctu2TsTY2GyKyo9hD JmchJ/scCKybfD9Og/b9ZWoqO5KGlLF0Tl+1mLWjT6vGoSoLNBchof96dXdCg7yrXN5H BDXoycrpLn52gjDPqRys6Brebzp4eqKdF9Y6OhVtXPgPmLrI54xBS1X2MO72rIiKF/2q Bwvqg76kit7s9xUNM9TRD3HsGuIla2PghrvvnLlq+GC4o+vOWDbHb6ZUytGRPlHpRk1f Iz6g== X-Gm-Message-State: AOAM532JD8Q6DwyhMsrrhXTq+dKFoCy7zFxSrtXYRb9C4W8rY+YT9OKr 8LTX7kf0edS5YKx8ezqnbNn20fdfYCEGeg== X-Google-Smtp-Source: ABdhPJwRlOYPTXvYaZa9SeLXyJF/e0M6yKPGXxe33JDDP5GazAdSdGsIOoWP1GPPGX0l22r/MRCv5g== X-Received: by 2002:a17:902:bd03:b0:13d:f6d7:813e with SMTP id p3-20020a170902bd0300b0013df6d7813emr11227582pls.1.1633724684185; Fri, 08 Oct 2021 13:24:44 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:43 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , John Garry , "James E.J. Bottomley" Subject: [PATCH v3 20/46] scsi: hisi_sas: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:27 -0700 Message-Id: <20211008202353.1448570-21-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 8 +++++--- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 8 +++++--- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 14 ++++++++------ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c index 862f4e8b7eb5..14a6065390ab 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c @@ -1749,11 +1749,13 @@ static int hisi_sas_v1_init(struct hisi_hba *hisi_hba) return 0; } -static struct device_attribute *host_attrs_v1_hw[] = { - &dev_attr_phy_event_threshold, +static struct attribute *host_v1_hw_attrs[] = { + &dev_attr_phy_event_threshold.attr, NULL }; +ATTRIBUTE_GROUPS(host_v1_hw); + static struct scsi_host_template sht_v1_hw = { .name = DRV_NAME, .proc_name = DRV_NAME, @@ -1777,7 +1779,7 @@ static struct scsi_host_template sht_v1_hw = { #ifdef CONFIG_COMPAT .compat_ioctl = sas_ioctl, #endif - .shost_attrs = host_attrs_v1_hw, + .shost_groups = host_v1_hw_groups, .host_reset = hisi_sas_host_reset, }; diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c index 236cf65c2f97..2ad80171c957 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c @@ -3542,11 +3542,13 @@ static void wait_cmds_complete_timeout_v2_hw(struct hisi_hba *hisi_hba, } -static struct device_attribute *host_attrs_v2_hw[] = { - &dev_attr_phy_event_threshold, +static struct attribute *host_v2_hw_attrs[] = { + &dev_attr_phy_event_threshold.attr, NULL }; +ATTRIBUTE_GROUPS(host_v2_hw); + static int map_queues_v2_hw(struct Scsi_Host *shost) { struct hisi_hba *hisi_hba = shost_priv(shost); @@ -3590,7 +3592,7 @@ static struct scsi_host_template sht_v2_hw = { #ifdef CONFIG_COMPAT .compat_ioctl = sas_ioctl, #endif - .shost_attrs = host_attrs_v2_hw, + .shost_groups = host_v2_hw_groups, .host_reset = hisi_sas_host_reset, .map_queues = map_queues_v2_hw, .host_tagset = 1, diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index f4517f3eb922..c84318869e8e 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -2771,14 +2771,16 @@ static int slave_configure_v3_hw(struct scsi_device *sdev) return 0; } -static struct device_attribute *host_attrs_v3_hw[] = { - &dev_attr_phy_event_threshold, - &dev_attr_intr_conv_v3_hw, - &dev_attr_intr_coal_ticks_v3_hw, - &dev_attr_intr_coal_count_v3_hw, +static struct attribute *host_v3_hw_attrs[] = { + &dev_attr_phy_event_threshold.attr, + &dev_attr_intr_conv_v3_hw.attr, + &dev_attr_intr_coal_ticks_v3_hw.attr, + &dev_attr_intr_coal_count_v3_hw.attr, NULL }; +ATTRIBUTE_GROUPS(host_v3_hw); + #define HISI_SAS_DEBUGFS_REG(x) {#x, x} struct hisi_sas_debugfs_reg_lu { @@ -3163,7 +3165,7 @@ static struct scsi_host_template sht_v3_hw = { #ifdef CONFIG_COMPAT .compat_ioctl = sas_ioctl, #endif - .shost_attrs = host_attrs_v3_hw, + .shost_groups = host_v3_hw_groups, .tag_alloc_policy = BLK_TAG_ALLOC_RR, .host_reset = hisi_sas_host_reset, .host_tagset = 1, From patchwork Fri Oct 8 20:23:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546329 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F7BDC433F5 for ; Fri, 8 Oct 2021 20:24:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7730D610E5 for ; Fri, 8 Oct 2021 20:24:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242591AbhJHU0p (ORCPT ); Fri, 8 Oct 2021 16:26:45 -0400 Received: from mail-pl1-f176.google.com ([209.85.214.176]:41482 "EHLO mail-pl1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242658AbhJHU0l (ORCPT ); Fri, 8 Oct 2021 16:26:41 -0400 Received: by mail-pl1-f176.google.com with SMTP id x8so6844234plv.8 for ; Fri, 08 Oct 2021 13:24:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vzGDEg+jAZR7uGnvCWr1TcRbXzy6bDQwywzwfMVHUFM=; b=OOkciXJCDwivgaRSb4ETWUncwGDjITfCoZjpXeRr2usbJJaJ5GXbx5OsznJrDHmUE/ CIjlFGC48kSEZaLCBqirbL4pXwt0NixDbDXK1kW6Ll6NG0NlUbdCIUlqfiEQMLTGCf9M vp6uZYcw8HMBQDnTDZjUGV05iaS/pRUPQN/HHEperB/HixQVjfi4hVLL7o3D3pG6FqlH UlS7LojjR7v7/B/i+oWcWRRWzGjelcOybwa37HGyUZUa8kJvRVnH6LCvm28yOop7eViS ZArE1i96rwF8V01jvZstomvRnMU+Dz5VRQBOjNKSuquPkUwQKrAr4TyDgFxcwzYsZH8T +Bdg== X-Gm-Message-State: AOAM531/oqSD4jzyGcORrRn6jZLn99JTWNwoI8c51Mu2Uq0wObExqDaG lkd92++F438FcfELmzHC+Xs= X-Google-Smtp-Source: ABdhPJx+G4pHCkl/MxlbRd55ViCjmVrbtERb6NsdQ0RVa1ixpnvzSR9ztubQpiCdN/aJRk3Erq285w== X-Received: by 2002:a17:902:a710:b029:12b:9b9f:c461 with SMTP id w16-20020a170902a710b029012b9b9fc461mr11471454plq.59.1633724685558; Fri, 08 Oct 2021 13:24:45 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:45 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Don Brace , "James E.J. Bottomley" Subject: [PATCH v3 21/46] scsi: hpsa: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:28 -0700 Message-Id: <20211008202353.1448570-22-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/hpsa.c | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 3faa87fa296a..8b0dc4be486e 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -936,30 +936,34 @@ static DEVICE_ATTR(ctlr_num, S_IRUGO, static DEVICE_ATTR(legacy_board, S_IRUGO, host_show_legacy_board, NULL); -static struct device_attribute *hpsa_sdev_attrs[] = { - &dev_attr_raid_level, - &dev_attr_lunid, - &dev_attr_unique_id, - &dev_attr_hp_ssd_smart_path_enabled, - &dev_attr_path_info, - &dev_attr_sas_address, +static struct attribute *hpsa_sdev_attrs[] = { + &dev_attr_raid_level.attr, + &dev_attr_lunid.attr, + &dev_attr_unique_id.attr, + &dev_attr_hp_ssd_smart_path_enabled.attr, + &dev_attr_path_info.attr, + &dev_attr_sas_address.attr, NULL, }; -static struct device_attribute *hpsa_shost_attrs[] = { - &dev_attr_rescan, - &dev_attr_firmware_revision, - &dev_attr_commands_outstanding, - &dev_attr_transport_mode, - &dev_attr_resettable, - &dev_attr_hp_ssd_smart_path_status, - &dev_attr_raid_offload_debug, - &dev_attr_lockup_detected, - &dev_attr_ctlr_num, - &dev_attr_legacy_board, +ATTRIBUTE_GROUPS(hpsa_sdev); + +static struct attribute *hpsa_shost_attrs[] = { + &dev_attr_rescan.attr, + &dev_attr_firmware_revision.attr, + &dev_attr_commands_outstanding.attr, + &dev_attr_transport_mode.attr, + &dev_attr_resettable.attr, + &dev_attr_hp_ssd_smart_path_status.attr, + &dev_attr_raid_offload_debug.attr, + &dev_attr_lockup_detected.attr, + &dev_attr_ctlr_num.attr, + &dev_attr_legacy_board.attr, NULL, }; +ATTRIBUTE_GROUPS(hpsa_shost); + #define HPSA_NRESERVED_CMDS (HPSA_CMDS_RESERVED_FOR_DRIVER +\ HPSA_MAX_CONCURRENT_PASSTHRUS) @@ -980,8 +984,8 @@ static struct scsi_host_template hpsa_driver_template = { #ifdef CONFIG_COMPAT .compat_ioctl = hpsa_compat_ioctl, #endif - .sdev_attrs = hpsa_sdev_attrs, - .shost_attrs = hpsa_shost_attrs, + .sdev_groups = hpsa_sdev_groups, + .shost_groups = hpsa_shost_groups, .max_sectors = 2048, .no_write_same = 1, }; From patchwork Fri Oct 8 20:23:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546331 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1231C433FE for ; Fri, 8 Oct 2021 20:24:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D935461019 for ; Fri, 8 Oct 2021 20:24:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242698AbhJHU0p (ORCPT ); Fri, 8 Oct 2021 16:26:45 -0400 Received: from mail-pj1-f53.google.com ([209.85.216.53]:33747 "EHLO mail-pj1-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242700AbhJHU0m (ORCPT ); Fri, 8 Oct 2021 16:26:42 -0400 Received: by mail-pj1-f53.google.com with SMTP id cs11-20020a17090af50b00b0019fe3df3dddso7748363pjb.0 for ; Fri, 08 Oct 2021 13:24:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SVOj+z+fC+OkziZLouFRzUSU9wn71Bv1br5KDIOkAMU=; b=sZGNpX76CL+xm49XrGjLzVLjsjpEo1Cp3L/2V2/siKehuhe6uY5GUGgKffpja1cKKP evpbbFTtuKWSwp6EgPn26ywHejljMbRMaNhbzdbnYpJiJa7qAUeJdNw46BMWufPSoLN4 CmxspBnkmKY00yEqaYkLRsuNYwjs4g4WgZEXlrleqEbpwte+zfBtBr4dl7gHEB+KMP8A gCx1WAMXC5ADKijqRZTfVUWMLd78UlltzqHbrGDBPONu/EkZp9qNJnFToJP6qxcpcPAS 2Yy2tu0kSvvif229a/2DO8kJ2XK/rSm4rWqR6OKdh0Sn5h2/nFi4plDpz/ik+gDaLZLQ RkDA== X-Gm-Message-State: AOAM530hczF/i83afEflHpLSEUyJ23FpXmvGU7XfbvhHekTeIwwxW1u0 H0xEaGPRPweUU/JE5I2UjQY= X-Google-Smtp-Source: ABdhPJyTcuTsH7wTQ0R2jTrB72ejNT1z8tiE6vvWFpyPgHi8CeJT+5+97V8yvz38dPC3D15FQw+s8g== X-Received: by 2002:a17:902:e743:b0:13f:18ba:c8a8 with SMTP id p3-20020a170902e74300b0013f18bac8a8mr3670550plf.72.1633724686917; Fri, 08 Oct 2021 13:24:46 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:46 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , HighPoint Linux Team , "James E.J. Bottomley" Subject: [PATCH v3 22/46] scsi: hptiop: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:29 -0700 Message-Id: <20211008202353.1448570-23-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/hptiop.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c index 61cda7b7624f..7250c1d7fffb 100644 --- a/drivers/scsi/hptiop.c +++ b/drivers/scsi/hptiop.c @@ -1150,12 +1150,14 @@ static struct device_attribute hptiop_attr_fw_version = { .show = hptiop_show_fw_version, }; -static struct device_attribute *hptiop_attrs[] = { - &hptiop_attr_version, - &hptiop_attr_fw_version, +static struct attribute *hptiop_host_attrs[] = { + &hptiop_attr_version.attr, + &hptiop_attr_fw_version.attr, NULL }; +ATTRIBUTE_GROUPS(hptiop_host); + static int hptiop_slave_config(struct scsi_device *sdev) { if (sdev->type == TYPE_TAPE) @@ -1172,7 +1174,7 @@ static struct scsi_host_template driver_template = { .info = hptiop_info, .emulated = 0, .proc_name = driver_name, - .shost_attrs = hptiop_attrs, + .shost_groups = hptiop_host_groups, .slave_configure = hptiop_slave_config, .this_id = -1, .change_queue_depth = hptiop_adjust_disk_queue_depth, From patchwork Fri Oct 8 20:23:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546333 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C8D7C433EF for ; Fri, 8 Oct 2021 20:24:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 47BAD610E7 for ; Fri, 8 Oct 2021 20:24:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242701AbhJHU0q (ORCPT ); Fri, 8 Oct 2021 16:26:46 -0400 Received: from mail-pj1-f53.google.com ([209.85.216.53]:39760 "EHLO mail-pj1-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242494AbhJHU0o (ORCPT ); Fri, 8 Oct 2021 16:26:44 -0400 Received: by mail-pj1-f53.google.com with SMTP id ls18-20020a17090b351200b001a00250584aso9673944pjb.4 for ; Fri, 08 Oct 2021 13:24:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kE5LxnwFISAmV7U8eafLq9RYsn5crmFkr10V2Fc9Pow=; b=n5FpZF004Ryn9+x/l5CaRPrKSiFz1k7aigZLrEQXBtoiP0Tplfoo6JpWafzyN9bgFc ZZr+15pyyJzwMDHVKFYnzkkrlDpg5KoW3fXoYLUI49Fhpq2FGe+y+KhS7sG2s3DyEOWZ CiYuYqz+5rHAWjABAr0alH9HwNnDAr/homtNc4YOKlsHI9Pqit9f04oxaDB66NiYJhuz rYFqGb9cLRx5K2hZZb884MqIrMNAgA2KOaxKi77oSLqPpM9Ru52Uo/jiFDeZmEdVH5Lz m3/jONR2LIrAoZpp6sLsN/JWbU7/zhHxAiF12G1tkYlWPRjeHizS39aPfvFFSGSDbUfF YGzg== X-Gm-Message-State: AOAM533+AyQNRKTw3UTT1QmF379WkbZ+4O8Qv3xGiH1JMetO7LglpNCQ 7YskHvXkjB/9IRSQ5t5Z4JE= X-Google-Smtp-Source: ABdhPJwVAAI2kOD24k3rZEAcEmJ+o72Vk2bWBfhs/zL5zJ2MppHrJ0QjTdFFshk46NF18ZFiMnkvCg== X-Received: by 2002:a17:902:9a83:b0:13e:5b1e:aa40 with SMTP id w3-20020a1709029a8300b0013e5b1eaa40mr11400171plp.41.1633724688331; Fri, 08 Oct 2021 13:24:48 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:47 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Tyrel Datwyler , Michael Ellerman , "James E.J. Bottomley" Subject: [PATCH v3 23/46] scsi: ibmvscsi: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:30 -0700 Message-Id: <20211008202353.1448570-24-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/ibmvscsi/ibmvscsi.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 50df7dd9cb91..053ca437d2a8 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -2064,18 +2064,20 @@ static int ibmvscsi_host_reset(struct Scsi_Host *shost, int reset_type) return 0; } -static struct device_attribute *ibmvscsi_attrs[] = { - &ibmvscsi_host_vhost_loc, - &ibmvscsi_host_vhost_name, - &ibmvscsi_host_srp_version, - &ibmvscsi_host_partition_name, - &ibmvscsi_host_partition_number, - &ibmvscsi_host_mad_version, - &ibmvscsi_host_os_type, - &ibmvscsi_host_config, +static struct attribute *ibmvscsi_host_attrs[] = { + &ibmvscsi_host_vhost_loc.attr, + &ibmvscsi_host_vhost_name.attr, + &ibmvscsi_host_srp_version.attr, + &ibmvscsi_host_partition_name.attr, + &ibmvscsi_host_partition_number.attr, + &ibmvscsi_host_mad_version.attr, + &ibmvscsi_host_os_type.attr, + &ibmvscsi_host_config.attr, NULL }; +ATTRIBUTE_GROUPS(ibmvscsi_host); + /* ------------------------------------------------------------ * SCSI driver registration */ @@ -2095,7 +2097,7 @@ static struct scsi_host_template driver_template = { .can_queue = IBMVSCSI_MAX_REQUESTS_DEFAULT, .this_id = -1, .sg_tablesize = SG_ALL, - .shost_attrs = ibmvscsi_attrs, + .shost_groups = ibmvscsi_host_groups, }; /** From patchwork Fri Oct 8 20:23:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546335 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AAF4C4332F for ; Fri, 8 Oct 2021 20:24:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 460B5610E5 for ; Fri, 8 Oct 2021 20:24:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242741AbhJHU0q (ORCPT ); Fri, 8 Oct 2021 16:26:46 -0400 Received: from mail-pl1-f177.google.com ([209.85.214.177]:38588 "EHLO mail-pl1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242653AbhJHU0p (ORCPT ); Fri, 8 Oct 2021 16:26:45 -0400 Received: by mail-pl1-f177.google.com with SMTP id x4so6893568pln.5 for ; Fri, 08 Oct 2021 13:24:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oPxm0WzT6vqmWC/6Ibhv1IqkIJD1vpHs2ypKVoufU7w=; b=h+/MNE+Z2ontsVebPMqPf7Lw0R3FY4CdcXQQKV1oID6WMK/X7/AqPjlmzmqq7md8bp a6WEt6MEl3l+2/OF8i+XsN862kARzgeAjAzcu6qGFowARpa5IA28Xbv7JQf92lgO9uxg 7VhsXRN0j0AXMZxqGUMGPS0pMVD0ZKfzNwMuedc/e6roWOSKDccNLLREt2euJ0Vd3AN9 LOK9ns7/qNMMY7TZWVh0cExPFMdH+oqVRgiojCN1n9hJFK4GlKGHomqh4GM18EiNlwhE Ef6gxTznT3r/m0wHzhW76sBTwcfRC8rk4skqoQLk0ogdkDsmgn0/2EHvJH/lHDz3c+aW QZAA== X-Gm-Message-State: AOAM531Aose4nNtr/wFiObh4YJN0X5b7zUvpfT7Rt+hdVl5c9uFaKboO n92QC28OF/nvNljGD0DPWYk= X-Google-Smtp-Source: ABdhPJwqcI84T4WEMXAV20pN6wguDWFyW1TlhzK60NWdUH6maZ1LYHwMbkfM60gWlNBqrs78/SWz/g== X-Received: by 2002:a17:902:bf07:b0:138:e32d:9f2e with SMTP id bi7-20020a170902bf0700b00138e32d9f2emr11165444plb.59.1633724689707; Fri, 08 Oct 2021 13:24:49 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:49 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Tyrel Datwyler , Michael Ellerman , "James E.J. Bottomley" Subject: [PATCH v3 24/46] scsi: ibmvfc: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:31 -0700 Message-Id: <20211008202353.1448570-25-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/ibmvscsi/ibmvfc.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index 1f1586ad48fe..bc3a608be136 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c @@ -3588,18 +3588,20 @@ static struct bin_attribute ibmvfc_trace_attr = { }; #endif -static struct device_attribute *ibmvfc_attrs[] = { - &dev_attr_partition_name, - &dev_attr_device_name, - &dev_attr_port_loc_code, - &dev_attr_drc_name, - &dev_attr_npiv_version, - &dev_attr_capabilities, - &dev_attr_log_level, - &dev_attr_nr_scsi_channels, +static struct attribute *ibmvfc_host_attrs[] = { + &dev_attr_partition_name.attr, + &dev_attr_device_name.attr, + &dev_attr_port_loc_code.attr, + &dev_attr_drc_name.attr, + &dev_attr_npiv_version.attr, + &dev_attr_capabilities.attr, + &dev_attr_log_level.attr, + &dev_attr_nr_scsi_channels.attr, NULL }; +ATTRIBUTE_GROUPS(ibmvfc_host); + static struct scsi_host_template driver_template = { .module = THIS_MODULE, .name = "IBM POWER Virtual FC Adapter", @@ -3620,7 +3622,7 @@ static struct scsi_host_template driver_template = { .this_id = -1, .sg_tablesize = SG_ALL, .max_sectors = IBMVFC_MAX_SECTORS, - .shost_attrs = ibmvfc_attrs, + .shost_groups = ibmvfc_host_groups, .track_queue_depth = 1, .host_tagset = 1, }; From patchwork Fri Oct 8 20:23:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546337 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93B2AC433EF for ; Fri, 8 Oct 2021 20:24:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7C48561019 for ; Fri, 8 Oct 2021 20:24:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242780AbhJHU0u (ORCPT ); Fri, 8 Oct 2021 16:26:50 -0400 Received: from mail-pj1-f42.google.com ([209.85.216.42]:46959 "EHLO mail-pj1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242783AbhJHU0r (ORCPT ); Fri, 8 Oct 2021 16:26:47 -0400 Received: by mail-pj1-f42.google.com with SMTP id pi19-20020a17090b1e5300b0019fdd3557d3so8627708pjb.5 for ; Fri, 08 Oct 2021 13:24:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pL0XsSmLM0S09oS82IXJArEaSeEy2ycMIy/uO6hE6rk=; b=qh0wQiQjgNkYKtrq+kQnSQS9ex6aBv6xRBGx12EDcAEIYhSXcYf2+hOwXiILctlqOm mVL6Fhrd8xvlT6gwFzzefdWch76ephQ8NHPiCDMqQfjEDYmYGxSCxhwqxtL5cpDCvqDM 6yIJLkaSex7iR+k8zTlr515WwIDQRgdrmoyeqi/KZ5jOdaPRvfi73iAs2TUCHxV3hzK1 EalIJZ6NKvbOHM5SoxNCTRoBArcCfPUGYUj13Wa60PCT23liyockkxohDX0GDJNVGwOc qD91ILb7FafD9RPwlLOiWth35MYcW/Kw49rTIHSiIzH5yhMHNMUleJbx7chEP/osA/27 1GKg== X-Gm-Message-State: AOAM530342y2N/j1ySVe4+iswPPDWoQEbY8KFTEETpSvUxIkNeMqcMBx MwbjPt7QowTpxfiTzW8O4uo= X-Google-Smtp-Source: ABdhPJyn32cgR65yNjXLI4/ulInsGtnQSpSoVdDktK8Cfg5EqhSEXdSzYXsT9YYfHrl2dRC2jQN6nw== X-Received: by 2002:a17:902:b095:b029:12c:de88:7d3b with SMTP id p21-20020a170902b095b029012cde887d3bmr11513324plr.15.1633724691180; Fri, 08 Oct 2021 13:24:51 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:50 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Brian King , "James E.J. Bottomley" Subject: [PATCH v3 25/46] scsi: ipr: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:32 -0700 Message-Id: <20211008202353.1448570-26-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/ipr.c | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 5d78f7e939a3..00862e84308c 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -4236,18 +4236,20 @@ static struct bin_attribute ipr_ioa_async_err_log = { .write = ipr_next_async_err_log }; -static struct device_attribute *ipr_ioa_attrs[] = { - &ipr_fw_version_attr, - &ipr_log_level_attr, - &ipr_diagnostics_attr, - &ipr_ioa_state_attr, - &ipr_ioa_reset_attr, - &ipr_update_fw_attr, - &ipr_ioa_fw_type_attr, - &ipr_iopoll_weight_attr, +static struct attribute *ipr_ioa_attrs[] = { + &ipr_fw_version_attr.attr, + &ipr_log_level_attr.attr, + &ipr_diagnostics_attr.attr, + &ipr_ioa_state_attr.attr, + &ipr_ioa_reset_attr.attr, + &ipr_update_fw_attr.attr, + &ipr_ioa_fw_type_attr.attr, + &ipr_iopoll_weight_attr.attr, NULL, }; +ATTRIBUTE_GROUPS(ipr_ioa); + #ifdef CONFIG_SCSI_IPR_DUMP /** * ipr_read_dump - Dump the adapter @@ -4732,15 +4734,17 @@ static struct device_attribute ipr_raw_mode_attr = { .store = ipr_store_raw_mode }; -static struct device_attribute *ipr_dev_attrs[] = { - &ipr_adapter_handle_attr, - &ipr_resource_path_attr, - &ipr_device_id_attr, - &ipr_resource_type_attr, - &ipr_raw_mode_attr, +static struct attribute *ipr_dev_attrs[] = { + &ipr_adapter_handle_attr.attr, + &ipr_resource_path_attr.attr, + &ipr_device_id_attr.attr, + &ipr_resource_type_attr.attr, + &ipr_raw_mode_attr.attr, NULL, }; +ATTRIBUTE_GROUPS(ipr_dev); + /** * ipr_biosparam - Return the HSC mapping * @sdev: scsi device struct @@ -6762,8 +6766,8 @@ static struct scsi_host_template driver_template = { .sg_tablesize = IPR_MAX_SGLIST, .max_sectors = IPR_IOA_MAX_SECTORS, .cmd_per_lun = IPR_MAX_CMD_PER_LUN, - .shost_attrs = ipr_ioa_attrs, - .sdev_attrs = ipr_dev_attrs, + .shost_groups = ipr_ioa_groups, + .sdev_groups = ipr_dev_groups, .proc_name = IPR_NAME, }; From patchwork Fri Oct 8 20:23:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546339 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96949C433F5 for ; Fri, 8 Oct 2021 20:24:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 82E7E61100 for ; Fri, 8 Oct 2021 20:24:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231727AbhJHU0v (ORCPT ); Fri, 8 Oct 2021 16:26:51 -0400 Received: from mail-pl1-f176.google.com ([209.85.214.176]:44856 "EHLO mail-pl1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242715AbhJHU0s (ORCPT ); Fri, 8 Oct 2021 16:26:48 -0400 Received: by mail-pl1-f176.google.com with SMTP id t11so6837618plq.11 for ; Fri, 08 Oct 2021 13:24:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lIZc4myGIvO1lQfZsYDnY5KKqCZ0WsbuHlQI25Sk/3k=; b=T0kK1f79+Xh20Rj+44n/fPDTtDvN9C4JQeQHTrED+CP8lQ4HAr4jzv9CZbjM4m9Bu/ +Rw9MxlAyZnPuieLR53mvk6OYKmmCh9TDzAQeGJ0RNnSOMlqXsJZ/tLpWzR6XdtNxc+C m0Qu8cUns7TdOPqsbd88TSyLTkDRJz5FH20G5tuwTnMS5+aoc9po9FyIg7WUbDyW3lNx NaGWRFVZnBFQjknkLYufAWRVK3wvr4oOtEqqAjSI3itmeBmoP2hh8j9yrMO+WH/9x3Fs W+zC1xdaNW85b3WyYoVjP0VKx9xwobNM+ZcBLvBDAOzsEGIFQpC74IVP5KeVFatsYxfQ FG5Q== X-Gm-Message-State: AOAM531/L2YB14nMCBAzli9/wZIqCl84D2tavUd+93EZB0hcr/TQmIlb sGRfA0VCCX0saalouRABchVeoZx96zSkZA== X-Google-Smtp-Source: ABdhPJwgWbw9mdY2Wnt4+ITzqonwePo56JS76QbCzHyoMRNm0fTxFHIcy3F++f9gDXK9117LdD3wmg== X-Received: by 2002:a17:902:8a83:b0:13d:9572:86c2 with SMTP id p3-20020a1709028a8300b0013d957286c2mr11450535plo.48.1633724692602; Fri, 08 Oct 2021 13:24:52 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:52 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Artur Paszkiewicz , "James E.J. Bottomley" Subject: [PATCH v3 26/46] scsi: isci: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:33 -0700 Message-Id: <20211008202353.1448570-27-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/isci/init.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c index ffd33e5decae..aade707c5553 100644 --- a/drivers/scsi/isci/init.c +++ b/drivers/scsi/isci/init.c @@ -142,11 +142,13 @@ static ssize_t isci_show_id(struct device *dev, struct device_attribute *attr, c static DEVICE_ATTR(isci_id, S_IRUGO, isci_show_id, NULL); -static struct device_attribute *isci_host_attrs[] = { - &dev_attr_isci_id, +static struct attribute *isci_host_attrs[] = { + &dev_attr_isci_id.attr, NULL }; +ATTRIBUTE_GROUPS(isci_host); + static struct scsi_host_template isci_sht = { .module = THIS_MODULE, @@ -173,7 +175,7 @@ static struct scsi_host_template isci_sht = { #ifdef CONFIG_COMPAT .compat_ioctl = sas_ioctl, #endif - .shost_attrs = isci_host_attrs, + .shost_groups = isci_host_groups, .track_queue_depth = 1, }; From patchwork Fri Oct 8 20:23:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546341 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A80BBC433FE for ; Fri, 8 Oct 2021 20:24:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D3D0610E7 for ; Fri, 8 Oct 2021 20:24:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242810AbhJHU0x (ORCPT ); Fri, 8 Oct 2021 16:26:53 -0400 Received: from mail-pf1-f175.google.com ([209.85.210.175]:35787 "EHLO mail-pf1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242443AbhJHU0u (ORCPT ); Fri, 8 Oct 2021 16:26:50 -0400 Received: by mail-pf1-f175.google.com with SMTP id c29so9126088pfp.2 for ; Fri, 08 Oct 2021 13:24:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HuPqne0Wah5BGBFKPQNKjpg6x1gUcuK25zyOnD8wkyQ=; b=haeyCkhLpuBIdUeNEI5EckjszMrojNv1/ZmFXMqwg+0NuYTczXoX2WwSuFfxrH4zLX kdBdUSIA+TEW7ivjuOL5r/wAX9E5czScDLnGZTkxW+XR2raS8H7z2uFQeyhxDlb14jrE xJwFMFCQVZmI5vVvXgRya+pmtak0hGDdPKLpxP2/s8Usn0VutEOjJIIYhYH360PBpq32 NKbPc2hp2clQKEn/HyvTZ1eYkEdUAh38yes4vGLdhTGmT3evyjE+7EuZSPAYYz8M6Xe6 2EUI5b54qdbrIJH+q9pYetg5J3doFeM6NqTjtgYgXGJBca3/dpiTlYgBowxdYpDKBE2I jagA== X-Gm-Message-State: AOAM530uVkpwab1B1Zi/qHz05NvQsUKqci+wJihpcMPnwnl56AqZTe+9 ve/Xok7BjJ8IMkweDEDO/WFjSRjAc2izkw== X-Google-Smtp-Source: ABdhPJz4BlHa7wb8HfW0LPLs+LdhyC/tMzyOszBef978NQJL133cSlOosEu/otoPjeU9USBuuhjDEA== X-Received: by 2002:a62:1b8e:0:b0:44c:9318:f6e1 with SMTP id b136-20020a621b8e000000b0044c9318f6e1mr12270983pfb.84.1633724694162; Fri, 08 Oct 2021 13:24:54 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:53 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , James Smart , Dick Kennedy , "James E.J. Bottomley" Subject: [PATCH v3 27/46] scsi: lpfc: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:34 -0700 Message-Id: <20211008202353.1448570-28-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/lpfc/lpfc_attr.c | 314 ++++++++++++++++++---------------- drivers/scsi/lpfc/lpfc_crtn.h | 4 +- drivers/scsi/lpfc/lpfc_init.c | 2 +- drivers/scsi/lpfc/lpfc_scsi.c | 4 +- 4 files changed, 171 insertions(+), 153 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index b35bf70a8c0d..2a6c938b2def 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c @@ -6396,160 +6396,178 @@ LPFC_ATTR_RW(vmid_priority_tagging, LPFC_VMID_PRIO_TAG_DISABLE, LPFC_VMID_PRIO_TAG_ALL_TARGETS, "Enable Priority Tagging VMID support"); -struct device_attribute *lpfc_hba_attrs[] = { - &dev_attr_nvme_info, - &dev_attr_scsi_stat, - &dev_attr_bg_info, - &dev_attr_bg_guard_err, - &dev_attr_bg_apptag_err, - &dev_attr_bg_reftag_err, - &dev_attr_info, - &dev_attr_serialnum, - &dev_attr_modeldesc, - &dev_attr_modelname, - &dev_attr_programtype, - &dev_attr_portnum, - &dev_attr_fwrev, - &dev_attr_hdw, - &dev_attr_option_rom_version, - &dev_attr_link_state, - &dev_attr_num_discovered_ports, - &dev_attr_menlo_mgmt_mode, - &dev_attr_lpfc_drvr_version, - &dev_attr_lpfc_enable_fip, - &dev_attr_lpfc_temp_sensor, - &dev_attr_lpfc_log_verbose, - &dev_attr_lpfc_lun_queue_depth, - &dev_attr_lpfc_tgt_queue_depth, - &dev_attr_lpfc_hba_queue_depth, - &dev_attr_lpfc_peer_port_login, - &dev_attr_lpfc_nodev_tmo, - &dev_attr_lpfc_devloss_tmo, - &dev_attr_lpfc_enable_fc4_type, - &dev_attr_lpfc_fcp_class, - &dev_attr_lpfc_use_adisc, - &dev_attr_lpfc_first_burst_size, - &dev_attr_lpfc_ack0, - &dev_attr_lpfc_xri_rebalancing, - &dev_attr_lpfc_topology, - &dev_attr_lpfc_scan_down, - &dev_attr_lpfc_link_speed, - &dev_attr_lpfc_fcp_io_sched, - &dev_attr_lpfc_ns_query, - &dev_attr_lpfc_fcp2_no_tgt_reset, - &dev_attr_lpfc_cr_delay, - &dev_attr_lpfc_cr_count, - &dev_attr_lpfc_multi_ring_support, - &dev_attr_lpfc_multi_ring_rctl, - &dev_attr_lpfc_multi_ring_type, - &dev_attr_lpfc_fdmi_on, - &dev_attr_lpfc_enable_SmartSAN, - &dev_attr_lpfc_max_luns, - &dev_attr_lpfc_enable_npiv, - &dev_attr_lpfc_fcf_failover_policy, - &dev_attr_lpfc_enable_rrq, - &dev_attr_lpfc_fcp_wait_abts_rsp, - &dev_attr_nport_evt_cnt, - &dev_attr_board_mode, - &dev_attr_max_vpi, - &dev_attr_used_vpi, - &dev_attr_max_rpi, - &dev_attr_used_rpi, - &dev_attr_max_xri, - &dev_attr_used_xri, - &dev_attr_npiv_info, - &dev_attr_issue_reset, - &dev_attr_lpfc_poll, - &dev_attr_lpfc_poll_tmo, - &dev_attr_lpfc_task_mgmt_tmo, - &dev_attr_lpfc_use_msi, - &dev_attr_lpfc_nvme_oas, - &dev_attr_lpfc_nvme_embed_cmd, - &dev_attr_lpfc_fcp_imax, - &dev_attr_lpfc_force_rscn, - &dev_attr_lpfc_cq_poll_threshold, - &dev_attr_lpfc_cq_max_proc_limit, - &dev_attr_lpfc_fcp_cpu_map, - &dev_attr_lpfc_fcp_mq_threshold, - &dev_attr_lpfc_hdw_queue, - &dev_attr_lpfc_irq_chann, - &dev_attr_lpfc_suppress_rsp, - &dev_attr_lpfc_nvmet_mrq, - &dev_attr_lpfc_nvmet_mrq_post, - &dev_attr_lpfc_nvme_enable_fb, - &dev_attr_lpfc_nvmet_fb_size, - &dev_attr_lpfc_enable_bg, - &dev_attr_lpfc_soft_wwnn, - &dev_attr_lpfc_soft_wwpn, - &dev_attr_lpfc_soft_wwn_enable, - &dev_attr_lpfc_enable_hba_reset, - &dev_attr_lpfc_enable_hba_heartbeat, - &dev_attr_lpfc_EnableXLane, - &dev_attr_lpfc_XLanePriority, - &dev_attr_lpfc_xlane_lun, - &dev_attr_lpfc_xlane_tgt, - &dev_attr_lpfc_xlane_vpt, - &dev_attr_lpfc_xlane_lun_state, - &dev_attr_lpfc_xlane_lun_status, - &dev_attr_lpfc_xlane_priority, - &dev_attr_lpfc_sg_seg_cnt, - &dev_attr_lpfc_max_scsicmpl_time, - &dev_attr_lpfc_stat_data_ctrl, - &dev_attr_lpfc_aer_support, - &dev_attr_lpfc_aer_state_cleanup, - &dev_attr_lpfc_sriov_nr_virtfn, - &dev_attr_lpfc_req_fw_upgrade, - &dev_attr_lpfc_suppress_link_up, - &dev_attr_iocb_hw, - &dev_attr_pls, - &dev_attr_pt, - &dev_attr_txq_hw, - &dev_attr_txcmplq_hw, - &dev_attr_lpfc_sriov_hw_max_virtfn, - &dev_attr_protocol, - &dev_attr_lpfc_xlane_supported, - &dev_attr_lpfc_enable_mds_diags, - &dev_attr_lpfc_ras_fwlog_buffsize, - &dev_attr_lpfc_ras_fwlog_level, - &dev_attr_lpfc_ras_fwlog_func, - &dev_attr_lpfc_enable_bbcr, - &dev_attr_lpfc_enable_dpp, - &dev_attr_lpfc_enable_mi, - &dev_attr_cmf_info, - &dev_attr_lpfc_max_vmid, - &dev_attr_lpfc_vmid_inactivity_timeout, - &dev_attr_lpfc_vmid_app_header, - &dev_attr_lpfc_vmid_priority_tagging, +static struct attribute *lpfc_hba_attrs[] = { + &dev_attr_nvme_info.attr, + &dev_attr_scsi_stat.attr, + &dev_attr_bg_info.attr, + &dev_attr_bg_guard_err.attr, + &dev_attr_bg_apptag_err.attr, + &dev_attr_bg_reftag_err.attr, + &dev_attr_info.attr, + &dev_attr_serialnum.attr, + &dev_attr_modeldesc.attr, + &dev_attr_modelname.attr, + &dev_attr_programtype.attr, + &dev_attr_portnum.attr, + &dev_attr_fwrev.attr, + &dev_attr_hdw.attr, + &dev_attr_option_rom_version.attr, + &dev_attr_link_state.attr, + &dev_attr_num_discovered_ports.attr, + &dev_attr_menlo_mgmt_mode.attr, + &dev_attr_lpfc_drvr_version.attr, + &dev_attr_lpfc_enable_fip.attr, + &dev_attr_lpfc_temp_sensor.attr, + &dev_attr_lpfc_log_verbose.attr, + &dev_attr_lpfc_lun_queue_depth.attr, + &dev_attr_lpfc_tgt_queue_depth.attr, + &dev_attr_lpfc_hba_queue_depth.attr, + &dev_attr_lpfc_peer_port_login.attr, + &dev_attr_lpfc_nodev_tmo.attr, + &dev_attr_lpfc_devloss_tmo.attr, + &dev_attr_lpfc_enable_fc4_type.attr, + &dev_attr_lpfc_fcp_class.attr, + &dev_attr_lpfc_use_adisc.attr, + &dev_attr_lpfc_first_burst_size.attr, + &dev_attr_lpfc_ack0.attr, + &dev_attr_lpfc_xri_rebalancing.attr, + &dev_attr_lpfc_topology.attr, + &dev_attr_lpfc_scan_down.attr, + &dev_attr_lpfc_link_speed.attr, + &dev_attr_lpfc_fcp_io_sched.attr, + &dev_attr_lpfc_ns_query.attr, + &dev_attr_lpfc_fcp2_no_tgt_reset.attr, + &dev_attr_lpfc_cr_delay.attr, + &dev_attr_lpfc_cr_count.attr, + &dev_attr_lpfc_multi_ring_support.attr, + &dev_attr_lpfc_multi_ring_rctl.attr, + &dev_attr_lpfc_multi_ring_type.attr, + &dev_attr_lpfc_fdmi_on.attr, + &dev_attr_lpfc_enable_SmartSAN.attr, + &dev_attr_lpfc_max_luns.attr, + &dev_attr_lpfc_enable_npiv.attr, + &dev_attr_lpfc_fcf_failover_policy.attr, + &dev_attr_lpfc_enable_rrq.attr, + &dev_attr_lpfc_fcp_wait_abts_rsp.attr, + &dev_attr_nport_evt_cnt.attr, + &dev_attr_board_mode.attr, + &dev_attr_max_vpi.attr, + &dev_attr_used_vpi.attr, + &dev_attr_max_rpi.attr, + &dev_attr_used_rpi.attr, + &dev_attr_max_xri.attr, + &dev_attr_used_xri.attr, + &dev_attr_npiv_info.attr, + &dev_attr_issue_reset.attr, + &dev_attr_lpfc_poll.attr, + &dev_attr_lpfc_poll_tmo.attr, + &dev_attr_lpfc_task_mgmt_tmo.attr, + &dev_attr_lpfc_use_msi.attr, + &dev_attr_lpfc_nvme_oas.attr, + &dev_attr_lpfc_nvme_embed_cmd.attr, + &dev_attr_lpfc_fcp_imax.attr, + &dev_attr_lpfc_force_rscn.attr, + &dev_attr_lpfc_cq_poll_threshold.attr, + &dev_attr_lpfc_cq_max_proc_limit.attr, + &dev_attr_lpfc_fcp_cpu_map.attr, + &dev_attr_lpfc_fcp_mq_threshold.attr, + &dev_attr_lpfc_hdw_queue.attr, + &dev_attr_lpfc_irq_chann.attr, + &dev_attr_lpfc_suppress_rsp.attr, + &dev_attr_lpfc_nvmet_mrq.attr, + &dev_attr_lpfc_nvmet_mrq_post.attr, + &dev_attr_lpfc_nvme_enable_fb.attr, + &dev_attr_lpfc_nvmet_fb_size.attr, + &dev_attr_lpfc_enable_bg.attr, + &dev_attr_lpfc_soft_wwnn.attr, + &dev_attr_lpfc_soft_wwpn.attr, + &dev_attr_lpfc_soft_wwn_enable.attr, + &dev_attr_lpfc_enable_hba_reset.attr, + &dev_attr_lpfc_enable_hba_heartbeat.attr, + &dev_attr_lpfc_EnableXLane.attr, + &dev_attr_lpfc_XLanePriority.attr, + &dev_attr_lpfc_xlane_lun.attr, + &dev_attr_lpfc_xlane_tgt.attr, + &dev_attr_lpfc_xlane_vpt.attr, + &dev_attr_lpfc_xlane_lun_state.attr, + &dev_attr_lpfc_xlane_lun_status.attr, + &dev_attr_lpfc_xlane_priority.attr, + &dev_attr_lpfc_sg_seg_cnt.attr, + &dev_attr_lpfc_max_scsicmpl_time.attr, + &dev_attr_lpfc_stat_data_ctrl.attr, + &dev_attr_lpfc_aer_support.attr, + &dev_attr_lpfc_aer_state_cleanup.attr, + &dev_attr_lpfc_sriov_nr_virtfn.attr, + &dev_attr_lpfc_req_fw_upgrade.attr, + &dev_attr_lpfc_suppress_link_up.attr, + &dev_attr_iocb_hw.attr, + &dev_attr_pls.attr, + &dev_attr_pt.attr, + &dev_attr_txq_hw.attr, + &dev_attr_txcmplq_hw.attr, + &dev_attr_lpfc_sriov_hw_max_virtfn.attr, + &dev_attr_protocol.attr, + &dev_attr_lpfc_xlane_supported.attr, + &dev_attr_lpfc_enable_mds_diags.attr, + &dev_attr_lpfc_ras_fwlog_buffsize.attr, + &dev_attr_lpfc_ras_fwlog_level.attr, + &dev_attr_lpfc_ras_fwlog_func.attr, + &dev_attr_lpfc_enable_bbcr.attr, + &dev_attr_lpfc_enable_dpp.attr, + &dev_attr_lpfc_enable_mi.attr, + &dev_attr_cmf_info.attr, + &dev_attr_lpfc_max_vmid.attr, + &dev_attr_lpfc_vmid_inactivity_timeout.attr, + &dev_attr_lpfc_vmid_app_header.attr, + &dev_attr_lpfc_vmid_priority_tagging.attr, NULL, }; -struct device_attribute *lpfc_vport_attrs[] = { - &dev_attr_info, - &dev_attr_link_state, - &dev_attr_num_discovered_ports, - &dev_attr_lpfc_drvr_version, - &dev_attr_lpfc_log_verbose, - &dev_attr_lpfc_lun_queue_depth, - &dev_attr_lpfc_tgt_queue_depth, - &dev_attr_lpfc_nodev_tmo, - &dev_attr_lpfc_devloss_tmo, - &dev_attr_lpfc_hba_queue_depth, - &dev_attr_lpfc_peer_port_login, - &dev_attr_lpfc_restrict_login, - &dev_attr_lpfc_fcp_class, - &dev_attr_lpfc_use_adisc, - &dev_attr_lpfc_first_burst_size, - &dev_attr_lpfc_max_luns, - &dev_attr_nport_evt_cnt, - &dev_attr_npiv_info, - &dev_attr_lpfc_enable_da_id, - &dev_attr_lpfc_max_scsicmpl_time, - &dev_attr_lpfc_stat_data_ctrl, - &dev_attr_lpfc_static_vport, - &dev_attr_cmf_info, +static const struct attribute_group lpfc_hba_attr_group = { + .attrs = lpfc_hba_attrs +}; + +const struct attribute_group *lpfc_hba_groups[] = { + &lpfc_hba_attr_group, + NULL +}; + +static struct attribute *lpfc_vport_attrs[] = { + &dev_attr_info.attr, + &dev_attr_link_state.attr, + &dev_attr_num_discovered_ports.attr, + &dev_attr_lpfc_drvr_version.attr, + &dev_attr_lpfc_log_verbose.attr, + &dev_attr_lpfc_lun_queue_depth.attr, + &dev_attr_lpfc_tgt_queue_depth.attr, + &dev_attr_lpfc_nodev_tmo.attr, + &dev_attr_lpfc_devloss_tmo.attr, + &dev_attr_lpfc_hba_queue_depth.attr, + &dev_attr_lpfc_peer_port_login.attr, + &dev_attr_lpfc_restrict_login.attr, + &dev_attr_lpfc_fcp_class.attr, + &dev_attr_lpfc_use_adisc.attr, + &dev_attr_lpfc_first_burst_size.attr, + &dev_attr_lpfc_max_luns.attr, + &dev_attr_nport_evt_cnt.attr, + &dev_attr_npiv_info.attr, + &dev_attr_lpfc_enable_da_id.attr, + &dev_attr_lpfc_max_scsicmpl_time.attr, + &dev_attr_lpfc_stat_data_ctrl.attr, + &dev_attr_lpfc_static_vport.attr, + &dev_attr_cmf_info.attr, NULL, }; +static const struct attribute_group lpfc_vport_attr_group = { + .attrs = lpfc_vport_attrs +}; + +const struct attribute_group *lpfc_vport_groups[] = { + &lpfc_vport_attr_group, + NULL +}; + /** * sysfs_ctlreg_write - Write method for writing to ctlreg * @filp: open sysfs file diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h index c512f4199142..ad4a954ecc09 100644 --- a/drivers/scsi/lpfc/lpfc_crtn.h +++ b/drivers/scsi/lpfc/lpfc_crtn.h @@ -428,8 +428,8 @@ void lpfc_get_cfgparam(struct lpfc_hba *); void lpfc_get_vport_cfgparam(struct lpfc_vport *); int lpfc_alloc_sysfs_attr(struct lpfc_vport *); void lpfc_free_sysfs_attr(struct lpfc_vport *); -extern struct device_attribute *lpfc_hba_attrs[]; -extern struct device_attribute *lpfc_vport_attrs[]; +extern const struct attribute_group *lpfc_hba_groups[]; +extern const struct attribute_group *lpfc_vport_groups[]; extern struct scsi_host_template lpfc_template; extern struct scsi_host_template lpfc_template_nvme; extern struct fc_function_template lpfc_transport_functions; diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index ea8f929eb3f7..4201bf05aa29 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -4574,7 +4574,7 @@ lpfc_create_port(struct lpfc_hba *phba, int instance, struct device *dev) /* Template for all vports this physical port creates */ memcpy(&phba->vport_template, &lpfc_template, sizeof(*template)); - phba->vport_template.shost_attrs = lpfc_vport_attrs; + phba->vport_template.shost_groups = lpfc_vport_groups; phba->vport_template.eh_bus_reset_handler = NULL; phba->vport_template.eh_host_reset_handler = NULL; phba->vport_template.vendor_id = 0; diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index 17e677cf8dcd..67345ee6ee58 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -7203,7 +7203,7 @@ struct scsi_host_template lpfc_template_nvme = { .this_id = -1, .sg_tablesize = 1, .cmd_per_lun = 1, - .shost_attrs = lpfc_hba_attrs, + .shost_groups = lpfc_hba_groups, .max_sectors = 0xFFFFFFFF, .vendor_id = LPFC_NL_VENDOR_ID, .track_queue_depth = 0, @@ -7229,7 +7229,7 @@ struct scsi_host_template lpfc_template = { .this_id = -1, .sg_tablesize = LPFC_DEFAULT_SG_SEG_CNT, .cmd_per_lun = LPFC_CMD_PER_LUN, - .shost_attrs = lpfc_hba_attrs, + .shost_groups = lpfc_hba_groups, .max_sectors = 0xFFFFFFFF, .vendor_id = LPFC_NL_VENDOR_ID, .change_queue_depth = scsi_change_queue_depth, From patchwork Fri Oct 8 20:23:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546343 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86AB8C433EF for ; Fri, 8 Oct 2021 20:25:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 724DF61152 for ; Fri, 8 Oct 2021 20:25:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242984AbhJHU05 (ORCPT ); Fri, 8 Oct 2021 16:26:57 -0400 Received: from mail-pl1-f181.google.com ([209.85.214.181]:38597 "EHLO mail-pl1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242700AbhJHU0v (ORCPT ); Fri, 8 Oct 2021 16:26:51 -0400 Received: by mail-pl1-f181.google.com with SMTP id x4so6893696pln.5 for ; Fri, 08 Oct 2021 13:24:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MKglPxxtWsZ4JxXkn0tjxCJiBfgbvPBkn1oV5hyjPG8=; b=aqFX+Mr3CDXHmfT91biuv9czxiWrKYCMf87MF/9MS/jOzsykIWh8VzGPlI0hSfNt5H F9T/obMDQEhRnanEznKo2DqOAFM1mib0wb32oj0eLgQK7naSBSi2zvUm8serfwHvOPx8 a/DRFXzFwwkinJSos/afFc973Uko6s8IvR/vdFJjHhRYjNPf1yeRGumvO3DNxHHYRB7m kG1zWrBo54ZnyVmXGvS6XAhT8J+wDLm39yEws3GGFdcfzgmvB6j/NXyJhabBndMYVB9G WgWSZAQPukw+GgPAEQoF9WJ8FJvpD7LDIedNjghX0rmSDMel9rm+OSlR3797OyhK1xl2 jXyw== X-Gm-Message-State: AOAM533OMB7DzpTW/VtLWN23yHyAkh0cFY2fw1T57tPre7MXvCdxT6mV E7UySi05Ssqy2TQGkEEhs98= X-Google-Smtp-Source: ABdhPJwQlEB+FJJikCHJ0l3rxGmAGyPZLAwEmYiZJc2H+xB+V3V/IS6p2kyjP6izYp+SfYxPgeA2lA== X-Received: by 2002:a17:90a:67c1:: with SMTP id g1mr14376852pjm.177.1633724695667; Fri, 08 Oct 2021 13:24:55 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:55 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Kashyap Desai , Sumit Saxena , Shivasharan S , "James E.J. Bottomley" Subject: [PATCH v3 28/46] scsi: megaraid: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:35 -0700 Message-Id: <20211008202353.1448570-29-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/megaraid/megaraid_mbox.c | 15 ++++++++------ drivers/scsi/megaraid/megaraid_sas_base.c | 24 ++++++++++++----------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c index d20c2e4ee793..bd1f64ae33dd 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.c +++ b/drivers/scsi/megaraid/megaraid_mbox.c @@ -305,20 +305,23 @@ static struct pci_driver megaraid_pci_driver = { static DEVICE_ATTR_ADMIN_RO(megaraid_mbox_app_hndl); // Host template initializer for megaraid mbox sysfs device attributes -static struct device_attribute *megaraid_shost_attrs[] = { - &dev_attr_megaraid_mbox_app_hndl, +static struct attribute *megaraid_shost_attrs[] = { + &dev_attr_megaraid_mbox_app_hndl.attr, NULL, }; +ATTRIBUTE_GROUPS(megaraid_shost); static DEVICE_ATTR_ADMIN_RO(megaraid_mbox_ld); // Host template initializer for megaraid mbox sysfs device attributes -static struct device_attribute *megaraid_sdev_attrs[] = { - &dev_attr_megaraid_mbox_ld, +static struct attribute *megaraid_sdev_attrs[] = { + &dev_attr_megaraid_mbox_ld.attr, NULL, }; +ATTRIBUTE_GROUPS(megaraid_sdev); + /* * Scsi host template for megaraid unified driver */ @@ -331,8 +334,8 @@ static struct scsi_host_template megaraid_template_g = { .eh_host_reset_handler = megaraid_reset_handler, .change_queue_depth = scsi_change_queue_depth, .no_write_same = 1, - .sdev_attrs = megaraid_sdev_attrs, - .shost_attrs = megaraid_shost_attrs, + .sdev_groups = megaraid_sdev_groups, + .shost_groups = megaraid_shost_groups, }; diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index e4298bf4a482..2011e081bca4 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -3481,19 +3481,21 @@ static DEVICE_ATTR_RW(enable_sdev_max_qd); static DEVICE_ATTR_RO(dump_system_regs); static DEVICE_ATTR_RO(raid_map_id); -static struct device_attribute *megaraid_host_attrs[] = { - &dev_attr_fw_crash_buffer_size, - &dev_attr_fw_crash_buffer, - &dev_attr_fw_crash_state, - &dev_attr_page_size, - &dev_attr_ldio_outstanding, - &dev_attr_fw_cmds_outstanding, - &dev_attr_enable_sdev_max_qd, - &dev_attr_dump_system_regs, - &dev_attr_raid_map_id, +static struct attribute *megaraid_host_attrs[] = { + &dev_attr_fw_crash_buffer_size.attr, + &dev_attr_fw_crash_buffer.attr, + &dev_attr_fw_crash_state.attr, + &dev_attr_page_size.attr, + &dev_attr_ldio_outstanding.attr, + &dev_attr_fw_cmds_outstanding.attr, + &dev_attr_enable_sdev_max_qd.attr, + &dev_attr_dump_system_regs.attr, + &dev_attr_raid_map_id.attr, NULL, }; +ATTRIBUTE_GROUPS(megaraid_host); + /* * Scsi host template for megaraid_sas driver */ @@ -3510,7 +3512,7 @@ static struct scsi_host_template megasas_template = { .eh_abort_handler = megasas_task_abort, .eh_host_reset_handler = megasas_reset_bus_host, .eh_timed_out = megasas_reset_timer, - .shost_attrs = megaraid_host_attrs, + .shost_groups = megaraid_host_groups, .bios_param = megasas_bios_param, .map_queues = megasas_map_queues, .mq_poll = megasas_blk_mq_poll, From patchwork Fri Oct 8 20:23:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546345 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E79F5C433F5 for ; Fri, 8 Oct 2021 20:25:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D318C61100 for ; Fri, 8 Oct 2021 20:25:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242570AbhJHU1B (ORCPT ); Fri, 8 Oct 2021 16:27:01 -0400 Received: from mail-pf1-f169.google.com ([209.85.210.169]:33656 "EHLO mail-pf1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242800AbhJHU0x (ORCPT ); Fri, 8 Oct 2021 16:26:53 -0400 Received: by mail-pf1-f169.google.com with SMTP id s16so9167799pfk.0 for ; Fri, 08 Oct 2021 13:24:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mh3M1EkLxaT+jqCdmvj7prtfnoNQvYX0HXxwkfhWPFs=; b=TwvRQ2qlTXdvn28tmEQjuNScYnz7xIy18/OBrIVWbqxICGYSVDImTuW6aj6OnI+M87 qe3P2SlCYeocbV70kYytOuPly2Ex/5SckFKZlgiJyJ0TmJrdfpVopqJaCD4vpLj+xqOi 2oSKiCMim1xw79rOQNN14pZB2aM/cRYSne2DhC+zqIFbdetMyiW23Mk8AGhhb2Epdo3d 8DMGjJDn80QxRJclK2v+hCK3pqJkiRM8CaIjdHrGqurXe+jadAE789aPuLf5pQwCd+2Q 1+BrkGZzczU3/R8WLwqZ871FBzDiLCajI0knyzMnQKXUlJTLCovr2oPgospDEMBm4dFO kKcg== X-Gm-Message-State: AOAM5330PXhZ6bTgfgTTWN7RENGLtFl42lcOsq6WkK2220U3sBLbSMRR xSTGUw1Yhv+vELUga6egXVI= X-Google-Smtp-Source: ABdhPJz3iRG74VFkZO8NKWtJTsEREXyaKWPD3PbcPhOlzJU+lw1noAJI+7AgxOFe4ahaNEdDGSwm5w== X-Received: by 2002:a63:6e8d:: with SMTP id j135mr6231596pgc.116.1633724697207; Fri, 08 Oct 2021 13:24:57 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.24.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:24:56 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Sathya Prakash , Sreekanth Reddy , Suganath Prabu Subramani , "James E.J. Bottomley" Subject: [PATCH v3 29/46] scsi: mpt3sas: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:36 -0700 Message-Id: <20211008202353.1448570-30-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/mpt3sas/mpt3sas_base.h | 4 +- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 84 +++++++++++++++++----------- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 8 +-- 3 files changed, 57 insertions(+), 39 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.h b/drivers/scsi/mpt3sas/mpt3sas_base.h index f87c0911f66a..db6a759de1e9 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.h +++ b/drivers/scsi/mpt3sas/mpt3sas_base.h @@ -1939,8 +1939,8 @@ mpt3sas_config_update_driver_trigger_pg4(struct MPT3SAS_ADAPTER *ioc, struct SL_WH_MPI_TRIGGERS_T *mpi_tg, bool set); /* ctl shared API */ -extern struct device_attribute *mpt3sas_host_attrs[]; -extern struct device_attribute *mpt3sas_dev_attrs[]; +extern const struct attribute_group *mpt3sas_host_groups[]; +extern const struct attribute_group *mpt3sas_dev_groups[]; void mpt3sas_ctl_init(ushort hbas_to_enumerate); void mpt3sas_ctl_exit(ushort hbas_to_enumerate); u8 mpt3sas_ctl_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3sas_ctl.c index 770b241d7bb2..adcf97a5ca81 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c +++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c @@ -3842,37 +3842,46 @@ enable_sdev_max_qd_store(struct device *cdev, } static DEVICE_ATTR_RW(enable_sdev_max_qd); -struct device_attribute *mpt3sas_host_attrs[] = { - &dev_attr_version_fw, - &dev_attr_version_bios, - &dev_attr_version_mpi, - &dev_attr_version_product, - &dev_attr_version_nvdata_persistent, - &dev_attr_version_nvdata_default, - &dev_attr_board_name, - &dev_attr_board_assembly, - &dev_attr_board_tracer, - &dev_attr_io_delay, - &dev_attr_device_delay, - &dev_attr_logging_level, - &dev_attr_fwfault_debug, - &dev_attr_fw_queue_depth, - &dev_attr_host_sas_address, - &dev_attr_ioc_reset_count, - &dev_attr_host_trace_buffer_size, - &dev_attr_host_trace_buffer, - &dev_attr_host_trace_buffer_enable, - &dev_attr_reply_queue_count, - &dev_attr_diag_trigger_master, - &dev_attr_diag_trigger_event, - &dev_attr_diag_trigger_scsi, - &dev_attr_diag_trigger_mpi, - &dev_attr_drv_support_bitmap, - &dev_attr_BRM_status, - &dev_attr_enable_sdev_max_qd, +static struct attribute *mpt3sas_host_attrs[] = { + &dev_attr_version_fw.attr, + &dev_attr_version_bios.attr, + &dev_attr_version_mpi.attr, + &dev_attr_version_product.attr, + &dev_attr_version_nvdata_persistent.attr, + &dev_attr_version_nvdata_default.attr, + &dev_attr_board_name.attr, + &dev_attr_board_assembly.attr, + &dev_attr_board_tracer.attr, + &dev_attr_io_delay.attr, + &dev_attr_device_delay.attr, + &dev_attr_logging_level.attr, + &dev_attr_fwfault_debug.attr, + &dev_attr_fw_queue_depth.attr, + &dev_attr_host_sas_address.attr, + &dev_attr_ioc_reset_count.attr, + &dev_attr_host_trace_buffer_size.attr, + &dev_attr_host_trace_buffer.attr, + &dev_attr_host_trace_buffer_enable.attr, + &dev_attr_reply_queue_count.attr, + &dev_attr_diag_trigger_master.attr, + &dev_attr_diag_trigger_event.attr, + &dev_attr_diag_trigger_scsi.attr, + &dev_attr_diag_trigger_mpi.attr, + &dev_attr_drv_support_bitmap.attr, + &dev_attr_BRM_status.attr, + &dev_attr_enable_sdev_max_qd.attr, NULL, }; +static const struct attribute_group mpt3sas_host_attr_group = { + .attrs = mpt3sas_host_attrs +}; + +const struct attribute_group *mpt3sas_host_groups[] = { + &mpt3sas_host_attr_group, + NULL +}; + /* device attributes */ /** @@ -3976,14 +3985,23 @@ sas_ncq_prio_enable_store(struct device *dev, } static DEVICE_ATTR_RW(sas_ncq_prio_enable); -struct device_attribute *mpt3sas_dev_attrs[] = { - &dev_attr_sas_address, - &dev_attr_sas_device_handle, - &dev_attr_sas_ncq_prio_supported, - &dev_attr_sas_ncq_prio_enable, +struct attribute *mpt3sas_dev_attrs[] = { + &dev_attr_sas_address.attr, + &dev_attr_sas_device_handle.attr, + &dev_attr_sas_ncq_prio_supported.attr, + &dev_attr_sas_ncq_prio_enable.attr, NULL, }; +static const struct attribute_group mpt3sas_dev_attr_group = { + .attrs = mpt3sas_dev_attrs +}; + +const struct attribute_group *mpt3sas_dev_groups[] = { + &mpt3sas_dev_attr_group, + NULL +}; + /* file operations table for mpt3ctl device */ static const struct file_operations ctl_fops = { .owner = THIS_MODULE, diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c index 2f82b1e629af..4806dd240d6b 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c +++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c @@ -11876,8 +11876,8 @@ static struct scsi_host_template mpt2sas_driver_template = { .sg_tablesize = MPT2SAS_SG_DEPTH, .max_sectors = 32767, .cmd_per_lun = 7, - .shost_attrs = mpt3sas_host_attrs, - .sdev_attrs = mpt3sas_dev_attrs, + .shost_groups = mpt3sas_host_groups, + .sdev_groups = mpt3sas_dev_groups, .track_queue_depth = 1, .cmd_size = sizeof(struct scsiio_tracker), }; @@ -11915,8 +11915,8 @@ static struct scsi_host_template mpt3sas_driver_template = { .max_sectors = 32767, .max_segment_size = 0xffffffff, .cmd_per_lun = 7, - .shost_attrs = mpt3sas_host_attrs, - .sdev_attrs = mpt3sas_dev_attrs, + .shost_groups = mpt3sas_host_groups, + .sdev_groups = mpt3sas_dev_groups, .track_queue_depth = 1, .cmd_size = sizeof(struct scsiio_tracker), .map_queues = scsih_map_queues, From patchwork Fri Oct 8 20:23:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546347 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D23D5C433EF for ; Fri, 8 Oct 2021 20:25:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BAC736112D for ; Fri, 8 Oct 2021 20:25:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242862AbhJHU1E (ORCPT ); Fri, 8 Oct 2021 16:27:04 -0400 Received: from mail-pl1-f177.google.com ([209.85.214.177]:39726 "EHLO mail-pl1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242688AbhJHU05 (ORCPT ); Fri, 8 Oct 2021 16:26:57 -0400 Received: by mail-pl1-f177.google.com with SMTP id c4so6885723pls.6 for ; Fri, 08 Oct 2021 13:25:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=q/iwhY8URVTeMCs+2vc+hIQceR1frC9+0UnoeCjR46U=; b=Hh7WJHXqwlh/lwPhlSsZW+1nOFCfuMA28ewnJvOqhUSRr51puzFY+XATGVRxLt8qeK ZaeqSYx2iQ3w91e+YDM9RZ676iAm4udku2KqCSaawtVVeAjRBS2Y3m2CqXajusk++pDt T9iQRAQ/NJWOLrGJbHCInijwCYP+sRI3Jm4DZIL/OjEjMcFJom1S9IP3V7FGv7J0VuGl H5KzB8u0+4Ge906hcsu1CAIpJ1QwLRruJdVtgZxVdfIRoNXmrwHY9iTkJxYwt4Xf5bXj B+ngdLs0LtcrLjAouoSfoNj+gH5U6rFtW5EYNCmrlTVzKbZQC7poHoowcOPAhrhNtKMF XLmg== X-Gm-Message-State: AOAM533/pjNU2ppfaS0dOhRIxvQpvS1RTxEEQlflSHkOlb36Jpg/fBZm NJwY9KXWcA0KlRhmb6Gh9wr2hvHtiVuykw== X-Google-Smtp-Source: ABdhPJwCTVRY9lBIuYkLk/5M4HwANTzJcm+vB0FNieXX75gd//LSM7DM+OvvLOWy6MqgvLQDFumZBw== X-Received: by 2002:a17:90a:44:: with SMTP id 4mr14158989pjb.130.1633724701684; Fri, 08 Oct 2021 13:25:01 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:25:01 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , "James E.J. Bottomley" , Yufen Yu , Jason Yan , Zhen Lei Subject: [PATCH v3 30/46] scsi: mvsas: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:37 -0700 Message-Id: <20211008202353.1448570-31-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/mvsas/mv_init.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c index f18dd9703595..dcae2d4464f9 100644 --- a/drivers/scsi/mvsas/mv_init.c +++ b/drivers/scsi/mvsas/mv_init.c @@ -25,7 +25,7 @@ static const struct mvs_chip_info mvs_chips[] = { [chip_1320] = { 2, 4, 0x800, 17, 64, 8, 9, &mvs_94xx_dispatch, }, }; -static struct device_attribute *mvst_host_attrs[]; +static const struct attribute_group *mvst_host_groups[]; #define SOC_SAS_NUM 2 @@ -52,7 +52,7 @@ static struct scsi_host_template mvs_sht = { #ifdef CONFIG_COMPAT .compat_ioctl = sas_ioctl, #endif - .shost_attrs = mvst_host_attrs, + .shost_groups = mvst_host_groups, .track_queue_depth = 1, }; @@ -773,12 +773,14 @@ static void __exit mvs_exit(void) sas_release_transport(mvs_stt); } -static struct device_attribute *mvst_host_attrs[] = { - &dev_attr_driver_version, - &dev_attr_interrupt_coalescing, +static struct attribute *mvst_host_attrs[] = { + &dev_attr_driver_version.attr, + &dev_attr_interrupt_coalescing.attr, NULL, }; +ATTRIBUTE_GROUPS(mvst_host); + module_init(mvs_init); module_exit(mvs_exit); From patchwork Fri Oct 8 20:23:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546349 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B047C433FE for ; Fri, 8 Oct 2021 20:25:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 45023610E7 for ; Fri, 8 Oct 2021 20:25:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242687AbhJHU1F (ORCPT ); Fri, 8 Oct 2021 16:27:05 -0400 Received: from mail-pj1-f46.google.com ([209.85.216.46]:51789 "EHLO mail-pj1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242985AbhJHU06 (ORCPT ); Fri, 8 Oct 2021 16:26:58 -0400 Received: by mail-pj1-f46.google.com with SMTP id kk10so8444684pjb.1 for ; Fri, 08 Oct 2021 13:25:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=24FcnP76JVFRjuZBpToKuYhGMB1lsEL0njGDm4SiUBM=; b=GZhXTP8u8Qzx9+sFwzzgnTsJMK2zDdEvfY3T8rFcqRqRr52826vva+DtlNe1em4BQ5 x+uHbGnF6gMEdlpiqnPTkTQVJVNF18X/Zfk4+ICG7U4sPHI8tYePyF2a7455iWXZlgYT xINk0lIla+dx6SQIwg74USilWeGu7AD7w1vE8HCasYDaNapAUfAGclGeebjECojULWa9 f//dP5KQWUh9HYV9rhsmiZoCRDrdDokymI4RWecv4p0sm6pa5R8jegxq9CVBO6a2QBMu N+OcSRFT1sCg0wYUdiSmFWaDjAqtpmudA5izMbdC1pxCEfLxndOwY4f5yH2ND1In9b/T a0tA== X-Gm-Message-State: AOAM531FY4ZK4IqJq6rJEwB3ENT8uUs10ukO+KWasur7rdO1ToB9b20+ xzz2TzzPEB1Uijb+/1TI3mod9KGp78u91A== X-Google-Smtp-Source: ABdhPJzWOSWZDGw0CGMhjdVuIAqnjEh1MIR1D0aK0NZ94aClAB+h9RY3zudfGykk+zhWdWc8GWXaaQ== X-Received: by 2002:a17:903:234f:b0:13e:e6e1:c132 with SMTP id c15-20020a170903234f00b0013ee6e1c132mr11529391plh.57.1633724703025; Fri, 08 Oct 2021 13:25:03 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:25:02 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Hannes Reinecke , "James E.J. Bottomley" Subject: [PATCH v3 31/46] scsi: myrb: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:38 -0700 Message-Id: <20211008202353.1448570-32-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/myrb.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/myrb.c b/drivers/scsi/myrb.c index a4a88323e020..72441c014f92 100644 --- a/drivers/scsi/myrb.c +++ b/drivers/scsi/myrb.c @@ -2182,22 +2182,26 @@ static ssize_t flush_cache_store(struct device *dev, } static DEVICE_ATTR_WO(flush_cache); -static struct device_attribute *myrb_sdev_attrs[] = { - &dev_attr_rebuild, - &dev_attr_consistency_check, - &dev_attr_raid_state, - &dev_attr_raid_level, +static struct attribute *myrb_sdev_attrs[] = { + &dev_attr_rebuild.attr, + &dev_attr_consistency_check.attr, + &dev_attr_raid_state.attr, + &dev_attr_raid_level.attr, NULL, }; -static struct device_attribute *myrb_shost_attrs[] = { - &dev_attr_ctlr_num, - &dev_attr_model, - &dev_attr_firmware, - &dev_attr_flush_cache, +ATTRIBUTE_GROUPS(myrb_sdev); + +static struct attribute *myrb_shost_attrs[] = { + &dev_attr_ctlr_num.attr, + &dev_attr_model.attr, + &dev_attr_firmware.attr, + &dev_attr_flush_cache.attr, NULL, }; +ATTRIBUTE_GROUPS(myrb_shost); + static struct scsi_host_template myrb_template = { .module = THIS_MODULE, .name = "DAC960", @@ -2209,8 +2213,8 @@ static struct scsi_host_template myrb_template = { .slave_destroy = myrb_slave_destroy, .bios_param = myrb_biosparam, .cmd_size = sizeof(struct myrb_cmdblk), - .shost_attrs = myrb_shost_attrs, - .sdev_attrs = myrb_sdev_attrs, + .shost_groups = myrb_shost_groups, + .sdev_groups = myrb_sdev_groups, .this_id = -1, }; From patchwork Fri Oct 8 20:23:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546351 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C3A8C433EF for ; Fri, 8 Oct 2021 20:25:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 005596112D for ; Fri, 8 Oct 2021 20:25:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242892AbhJHU1G (ORCPT ); Fri, 8 Oct 2021 16:27:06 -0400 Received: from mail-pl1-f178.google.com ([209.85.214.178]:33475 "EHLO mail-pl1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242700AbhJHU1A (ORCPT ); Fri, 8 Oct 2021 16:27:00 -0400 Received: by mail-pl1-f178.google.com with SMTP id a11so6925186plm.0 for ; Fri, 08 Oct 2021 13:25:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EUe+T7BRbW2HGNCh4VxgcEN8rcNEKp+5yJ/I85ScS7k=; b=g0xV3d4ZeAxa23BNSByyckCzgyxQuJ51M2PkxD8DO2WxgLhW5fJckCgV5+cjqwIbd0 AQ2KjKkeuEAp2JRuqhQ4fMGP9kXpjHNChDa2J/MXbAPxCxOvxYgPFOPn4/9X+BL/d7PE Em199sEYgX6/KmJxnE0BIlSccNrDDON4hnxmkNy4gL6n2H4nLFwHtzHzCImh41ovfvDq 4rK3xz1V2+RzAB0Ed00fkBxP+Y8/xX2Xa/5GVIKHYyEwoJCaVK6By7lXRS9SSxho7qjq Jff6BjblFs+IAzU6KO8PCKeflzQyf7Erqhb34v7QdIKtXc3DCCLxJ0DTsXF7tANADY3U hnjw== X-Gm-Message-State: AOAM5325DIZMW4B6MfIonxkq5vxQaZvxM671eSbWvAGqn2sF9AedqXu6 4bOALnIhKTCOxFOWTJU3LL4= X-Google-Smtp-Source: ABdhPJyj6mXZrWqeTBCR4+7PWPcVYhWrh+CPFLw/Q7qoTtueizHpkkUM2YYjZBQ96lgB03P74Bjk2w== X-Received: by 2002:a17:903:230e:b0:13f:5f6:3722 with SMTP id d14-20020a170903230e00b0013f05f63722mr11006291plh.84.1633724704425; Fri, 08 Oct 2021 13:25:04 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:25:03 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Hannes Reinecke , "James E.J. Bottomley" Subject: [PATCH v3 32/46] scsi: myrs: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:39 -0700 Message-Id: <20211008202353.1448570-33-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/myrs.c | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/drivers/scsi/myrs.c b/drivers/scsi/myrs.c index 07f274afd7e5..ca42f7f6244b 100644 --- a/drivers/scsi/myrs.c +++ b/drivers/scsi/myrs.c @@ -1286,14 +1286,16 @@ static ssize_t consistency_check_store(struct device *dev, } static DEVICE_ATTR_RW(consistency_check); -static struct device_attribute *myrs_sdev_attrs[] = { - &dev_attr_consistency_check, - &dev_attr_rebuild, - &dev_attr_raid_state, - &dev_attr_raid_level, +static struct attribute *myrs_sdev_attrs[] = { + &dev_attr_consistency_check.attr, + &dev_attr_rebuild.attr, + &dev_attr_raid_state.attr, + &dev_attr_raid_level.attr, NULL, }; +ATTRIBUTE_GROUPS(myrs_sdev); + static ssize_t serial_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -1510,20 +1512,22 @@ static ssize_t disable_enclosure_messages_store(struct device *dev, } static DEVICE_ATTR_RW(disable_enclosure_messages); -static struct device_attribute *myrs_shost_attrs[] = { - &dev_attr_serial, - &dev_attr_ctlr_num, - &dev_attr_processor, - &dev_attr_model, - &dev_attr_ctlr_type, - &dev_attr_cache_size, - &dev_attr_firmware, - &dev_attr_discovery, - &dev_attr_flush_cache, - &dev_attr_disable_enclosure_messages, +static struct attribute *myrs_shost_attrs[] = { + &dev_attr_serial.attr, + &dev_attr_ctlr_num.attr, + &dev_attr_processor.attr, + &dev_attr_model.attr, + &dev_attr_ctlr_type.attr, + &dev_attr_cache_size.attr, + &dev_attr_firmware.attr, + &dev_attr_discovery.attr, + &dev_attr_flush_cache.attr, + &dev_attr_disable_enclosure_messages.attr, NULL, }; +ATTRIBUTE_GROUPS(myrs_shost); + /* * SCSI midlayer interface */ @@ -1923,8 +1927,8 @@ static struct scsi_host_template myrs_template = { .slave_configure = myrs_slave_configure, .slave_destroy = myrs_slave_destroy, .cmd_size = sizeof(struct myrs_cmdblk), - .shost_attrs = myrs_shost_attrs, - .sdev_attrs = myrs_sdev_attrs, + .shost_groups = myrs_shost_groups, + .sdev_groups = myrs_sdev_groups, .this_id = -1, }; From patchwork Fri Oct 8 20:23:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546353 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C75FDC433EF for ; Fri, 8 Oct 2021 20:25:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B033361100 for ; Fri, 8 Oct 2021 20:25:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242782AbhJHU1I (ORCPT ); Fri, 8 Oct 2021 16:27:08 -0400 Received: from mail-pf1-f181.google.com ([209.85.210.181]:36785 "EHLO mail-pf1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242765AbhJHU1B (ORCPT ); Fri, 8 Oct 2021 16:27:01 -0400 Received: by mail-pf1-f181.google.com with SMTP id m26so9133640pff.3 for ; Fri, 08 Oct 2021 13:25:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=W0A/Jo7ruNv71phDeQouqyaE0CgD5Vcq7kG8jaJjaCc=; b=AAsIxaA7ZJEfXP5eDvbUcQcqgwdhCY4X8ce14CzcWqwYEj61Q8Sn71g1FfqQvwp7UH Oz2SLwnyTdlY3DrT6sU3klUsUh7pU9gI3X9OGn/k0fPv19+/qA8qbZkOHy9qNvLHujmG hez5EPJNdVCOV/sfAz6vN74JMwsUWYFYavXNNXnklTh2ZXpSLlZuxBJHYMuzS7SCFa7D G4ULV25U6Qy52vvndJmmwulOLZ9eXDxxs4uEcFYbRQknJs7Imf66E3wQuiWoFNF3qcUt QqF7IdmG9Ry5a5NA8GvTGgHTVwapHpZt4Oiu7V5FRu8XWiI7c/ZaJ+97yxMcMMIh0rs6 vIkQ== X-Gm-Message-State: AOAM533Ey5ahfgL3Xucn10PCTIryTPIFf4heYt943On2jt8+ipf+ELEb sz9wPwrNy4iwlE9nV9tGmmM= X-Google-Smtp-Source: ABdhPJxFszkVj4AX0O9uEmCdJErd9G/6eTOEov02OI+JDpvtOzyZBTDehef4Nut4cbJCjJYqRKC7ww== X-Received: by 2002:a63:390:: with SMTP id 138mr6367995pgd.37.1633724705738; Fri, 08 Oct 2021 13:25:05 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:25:05 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , "James E.J. Bottomley" Subject: [PATCH v3 33/46] scsi: ncr53c8xx: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:40 -0700 Message-Id: <20211008202353.1448570-34-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/ncr53c8xx.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c index 2b8c6fa5e775..57fa29a1bcc0 100644 --- a/drivers/scsi/ncr53c8xx.c +++ b/drivers/scsi/ncr53c8xx.c @@ -8039,11 +8039,13 @@ static struct device_attribute ncr53c8xx_revision_attr = { .show = show_ncr53c8xx_revision, }; -static struct device_attribute *ncr53c8xx_host_attrs[] = { - &ncr53c8xx_revision_attr, +static struct attribute *ncr53c8xx_host_attrs[] = { + &ncr53c8xx_revision_attr.attr, NULL }; +ATTRIBUTE_GROUPS(ncr53c8xx_host); + /*========================================================== ** ** Boot command line. @@ -8085,8 +8087,8 @@ struct Scsi_Host * __init ncr_attach(struct scsi_host_template *tpnt, if (!tpnt->name) tpnt->name = SCSI_NCR_DRIVER_NAME; - if (!tpnt->shost_attrs) - tpnt->shost_attrs = ncr53c8xx_host_attrs; + if (!tpnt->shost_groups) + tpnt->shost_groups = ncr53c8xx_host_groups; tpnt->queuecommand = ncr53c8xx_queue_command; tpnt->slave_configure = ncr53c8xx_slave_configure; From patchwork Fri Oct 8 20:23:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546355 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C482EC433EF for ; Fri, 8 Oct 2021 20:25:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AAB5D610E7 for ; Fri, 8 Oct 2021 20:25:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242698AbhJHU1L (ORCPT ); Fri, 8 Oct 2021 16:27:11 -0400 Received: from mail-pl1-f175.google.com ([209.85.214.175]:43739 "EHLO mail-pl1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242880AbhJHU1G (ORCPT ); Fri, 8 Oct 2021 16:27:06 -0400 Received: by mail-pl1-f175.google.com with SMTP id y1so6835726plk.10 for ; Fri, 08 Oct 2021 13:25:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=o/KCwi6Jatb0W2TFXLG/+J51xr3UgQp4E1sK00H0/tY=; b=CsIXn0LVaDuIGk5mo/JdkW+REGF4nCNTiDZNeiCxHcNgbUXH/bRoBzrms9guB6kYec McPz9vEKMS6VE6aWx2phlea2EGSX6H/zIvgIZHa1OWiOHuGOEz1gWhH7Y7GPA9ucMPZA O+TOL4HEjckUbZVxZb9t/uDBm8dETfNu8ofeRdUfvFDTXFcDDLY1JAAOGk0WS3cBa5D8 NTVsgpzVRGYQGCnpFFQsSwwssI7SQNnKQ0RPKB4RsOAXpvku7yAlfPJY8rmwHPP+73at UCJRC7IH4itR4LmnKSpTkxRhOvruwkGScsfFXt0JYyzdstP3HTsoVlbyYI5RM/1qAvZ2 HBgg== X-Gm-Message-State: AOAM530j/nA3gD6kT9tYYmFxGaFVurX4ZZhvSsbDGhD7prRyBdn22vKV 5oVckaIRisNWupCR7H/tNk4= X-Google-Smtp-Source: ABdhPJx2+A2r7Nc/Wf/kuB/OC7QZ03J+ssH6gnCRduD7OvTwsdZyVc6/P60Iy1TmBLFjgK1Q9PT5OA== X-Received: by 2002:a17:902:db0e:b0:13e:f4d3:84c with SMTP id m14-20020a170902db0e00b0013ef4d3084cmr11132866plx.2.1633724710339; Fri, 08 Oct 2021 13:25:10 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.25.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:25:09 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , "James E.J. Bottomley" Subject: [PATCH v3 34/46] scsi: sym53c500_cs: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:41 -0700 Message-Id: <20211008202353.1448570-35-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/pcmcia/sym53c500_cs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c index a366ff1a3959..873d1121113a 100644 --- a/drivers/scsi/pcmcia/sym53c500_cs.c +++ b/drivers/scsi/pcmcia/sym53c500_cs.c @@ -652,11 +652,13 @@ static struct device_attribute SYM53C500_pio_attr = { .store = SYM53C500_store_pio, }; -static struct device_attribute *SYM53C500_shost_attrs[] = { - &SYM53C500_pio_attr, +static struct attribute *SYM53C500_shost_attrs[] = { + &SYM53C500_pio_attr.attr, NULL, }; +ATTRIBUTE_GROUPS(SYM53C500_shost); + /* * scsi_host_template initializer */ @@ -671,7 +673,7 @@ static struct scsi_host_template sym53c500_driver_template = { .can_queue = 1, .this_id = 7, .sg_tablesize = 32, - .shost_attrs = SYM53C500_shost_attrs + .shost_groups = SYM53C500_shost_groups }; static int SYM53C500_config_check(struct pcmcia_device *p_dev, void *priv_data) From patchwork Fri Oct 8 20:23:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546357 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24A8EC433F5 for ; Fri, 8 Oct 2021 20:25:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0DB50610E7 for ; Fri, 8 Oct 2021 20:25:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242898AbhJHU1M (ORCPT ); Fri, 8 Oct 2021 16:27:12 -0400 Received: from mail-pj1-f43.google.com ([209.85.216.43]:51796 "EHLO mail-pj1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242900AbhJHU1H (ORCPT ); Fri, 8 Oct 2021 16:27:07 -0400 Received: by mail-pj1-f43.google.com with SMTP id kk10so8444943pjb.1 for ; Fri, 08 Oct 2021 13:25:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=A3h7aoMc84NKzjzZE/fO895YxKdkZ5QtZ6t4kOQrxBg=; b=pfCzoTTenazp07KwN46ryXVd0r2H7FP7L1eReHZycD85H+/JEuPqeNDk5BJjfW4tWO ti+TyQvBTc9jGcSxMW/d1lk/WU8efrF9oh+jTWh0vFmwI9WXme9kErs5h7W1lnnWcJ2K XxwYNfDOI6YczFBbfUnsJTsE0ngrd1HotKBaT0r5UIVE4hnQKx+2WGMJ3vzGeIWoj8s0 +/4LAZdTgq4+e/qRazGtdYYI6+2rjXbI/Fpo6za2DtvfwtxIArDMP7vFcGv0tiPgl7kG cU+e+7zTbIetJImfPcR5+h8fIlP7WdK8rtqGE1hFI58FYhcfY0tKyiCRdRu6ywToXVbK 8How== X-Gm-Message-State: AOAM533AFsOV0V0Bzv2TNwrNSJzrvtXrPHAXYOyCyA/2LgOXbfu38DSl EuTZVfbZaLjRwdk9OXxYcio= X-Google-Smtp-Source: ABdhPJzsAjRUCHx5md3vuacL05rN6XJ7JOBa59SoLZHjV2DywbcSmmSXUUIWDOq5q2YprO10/mtv7g== X-Received: by 2002:a17:903:1ca:b0:13e:f367:9361 with SMTP id e10-20020a17090301ca00b0013ef3679361mr11426377plh.3.1633724711763; Fri, 08 Oct 2021 13:25:11 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.25.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:25:11 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Jack Wang , "James E.J. Bottomley" Subject: [PATCH v3 35/46] scsi: pm8001: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:42 -0700 Message-Id: <20211008202353.1448570-36-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche Acked-by: Jack Wang --- drivers/scsi/pm8001/pm8001_ctl.c | 64 +++++++++++++++++-------------- drivers/scsi/pm8001/pm8001_init.c | 2 +- drivers/scsi/pm8001/pm8001_sas.h | 2 +- 3 files changed, 38 insertions(+), 30 deletions(-) diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c index b25e447aa3bd..397eb9f6a1dd 100644 --- a/drivers/scsi/pm8001/pm8001_ctl.c +++ b/drivers/scsi/pm8001/pm8001_ctl.c @@ -1002,34 +1002,42 @@ static ssize_t ctl_iop1_count_show(struct device *cdev, } static DEVICE_ATTR_RO(ctl_iop1_count); -struct device_attribute *pm8001_host_attrs[] = { - &dev_attr_interface_rev, - &dev_attr_controller_fatal_error, - &dev_attr_fw_version, - &dev_attr_update_fw, - &dev_attr_aap_log, - &dev_attr_iop_log, - &dev_attr_fatal_log, - &dev_attr_non_fatal_log, - &dev_attr_non_fatal_count, - &dev_attr_gsm_log, - &dev_attr_max_out_io, - &dev_attr_max_devices, - &dev_attr_max_sg_list, - &dev_attr_sas_spec_support, - &dev_attr_logging_level, - &dev_attr_event_log_size, - &dev_attr_host_sas_address, - &dev_attr_bios_version, - &dev_attr_ib_log, - &dev_attr_ob_log, - &dev_attr_ila_version, - &dev_attr_inc_fw_ver, - &dev_attr_ctl_mpi_state, - &dev_attr_ctl_hmi_error, - &dev_attr_ctl_raae_count, - &dev_attr_ctl_iop0_count, - &dev_attr_ctl_iop1_count, +static struct attribute *pm8001_host_attrs[] = { + &dev_attr_interface_rev.attr, + &dev_attr_controller_fatal_error.attr, + &dev_attr_fw_version.attr, + &dev_attr_update_fw.attr, + &dev_attr_aap_log.attr, + &dev_attr_iop_log.attr, + &dev_attr_fatal_log.attr, + &dev_attr_non_fatal_log.attr, + &dev_attr_non_fatal_count.attr, + &dev_attr_gsm_log.attr, + &dev_attr_max_out_io.attr, + &dev_attr_max_devices.attr, + &dev_attr_max_sg_list.attr, + &dev_attr_sas_spec_support.attr, + &dev_attr_logging_level.attr, + &dev_attr_event_log_size.attr, + &dev_attr_host_sas_address.attr, + &dev_attr_bios_version.attr, + &dev_attr_ib_log.attr, + &dev_attr_ob_log.attr, + &dev_attr_ila_version.attr, + &dev_attr_inc_fw_ver.attr, + &dev_attr_ctl_mpi_state.attr, + &dev_attr_ctl_hmi_error.attr, + &dev_attr_ctl_raae_count.attr, + &dev_attr_ctl_iop0_count.attr, + &dev_attr_ctl_iop1_count.attr, NULL, }; +static const struct attribute_group pm8001_host_attr_group = { + .attrs = pm8001_host_attrs +}; + +const struct attribute_group *pm8001_host_groups[] = { + &pm8001_host_attr_group, + NULL +}; diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c index 7082fecf7ce8..bed8cc125544 100644 --- a/drivers/scsi/pm8001/pm8001_init.c +++ b/drivers/scsi/pm8001/pm8001_init.c @@ -107,7 +107,7 @@ static struct scsi_host_template pm8001_sht = { #ifdef CONFIG_COMPAT .compat_ioctl = sas_ioctl, #endif - .shost_attrs = pm8001_host_attrs, + .shost_groups = pm8001_host_groups, .track_queue_depth = 1, }; diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h index 7e999768bfd2..83eec16d021d 100644 --- a/drivers/scsi/pm8001/pm8001_sas.h +++ b/drivers/scsi/pm8001/pm8001_sas.h @@ -733,7 +733,7 @@ ssize_t pm8001_get_gsm_dump(struct device *cdev, u32, char *buf); int pm80xx_fatal_errors(struct pm8001_hba_info *pm8001_ha); void pm8001_free_dev(struct pm8001_device *pm8001_dev); /* ctl shared API */ -extern struct device_attribute *pm8001_host_attrs[]; +extern const struct attribute_group *pm8001_host_groups[]; static inline void pm8001_ccb_task_free_done(struct pm8001_hba_info *pm8001_ha, From patchwork Fri Oct 8 20:23:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546359 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EDFAC433EF for ; Fri, 8 Oct 2021 20:25:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 636576112D for ; Fri, 8 Oct 2021 20:25:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242765AbhJHU1S (ORCPT ); Fri, 8 Oct 2021 16:27:18 -0400 Received: from mail-pj1-f50.google.com ([209.85.216.50]:44791 "EHLO mail-pj1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242783AbhJHU1I (ORCPT ); Fri, 8 Oct 2021 16:27:08 -0400 Received: by mail-pj1-f50.google.com with SMTP id oa12-20020a17090b1bcc00b0019f715462a8so8631045pjb.3 for ; Fri, 08 Oct 2021 13:25:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ttBrfGfVvdCJO0vAdUa5pmDj9rhhdRZtsp4QZiZrF2U=; b=22NQpr6x6U3f7LWBY3JhCIAohWVegzJTA5xmj4+THbrjQtRfBiZtt02Bdrgr4/eSsd k1l1lZPNY1n4i0A3cbSrbOJzezaiCMRt/Kt4xCaWL4RRZ7PWaiXseGpnV3EzxQcJ5adN Ok+3YVtBuuq9dp+EJ93sPYn211jzrAw52O4UVbiIq8WIWR+Oq+shuoJjIj3tt2gApVbh JzbUdjbBPcQi8uxaMrOAK0B8raVSjAMvSAxgSm2/yHZlFrdjFlHO3B7IMwEXXWHLMMrz O/tnJCoVfNo1tNqnBa3u3F5cBVKpVqVsD1mbKr/NGkI7GmI7tkCg8rwU3KJNAdtChH81 o1IQ== X-Gm-Message-State: AOAM530S1UwLYKCFtIO5rFUKse1kqtddz2sH2Fk7DmXNv1ZyIX3a1pIx 1ker8yTVmhN0VgspGmqz6iCwq/temtxAjQ== X-Google-Smtp-Source: ABdhPJx1OSdj6CtpMvqUUjRzU8Ood4LZtApeKa61gkYffAbfTqG2M1FOe3i3uJgpnt2PQOMj8aH7wA== X-Received: by 2002:a17:903:2287:b0:13e:5d9f:1ebf with SMTP id b7-20020a170903228700b0013e5d9f1ebfmr11178870plh.75.1633724713020; Fri, 08 Oct 2021 13:25:13 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.25.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:25:12 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , "James E.J. Bottomley" Subject: [PATCH v3 36/46] scsi: pmcraid: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:43 -0700 Message-Id: <20211008202353.1448570-37-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/pmcraid.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index bffd9a9349e7..ce08bd34f205 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c @@ -4097,13 +4097,14 @@ static struct device_attribute pmcraid_adapter_id_attr = { .show = pmcraid_show_adapter_id, }; -static struct device_attribute *pmcraid_host_attrs[] = { - &pmcraid_log_level_attr, - &pmcraid_driver_version_attr, - &pmcraid_adapter_id_attr, +static struct attribute *pmcraid_host_attrs[] = { + &pmcraid_log_level_attr.attr, + &pmcraid_driver_version_attr.attr, + &pmcraid_adapter_id_attr.attr, NULL, }; +ATTRIBUTE_GROUPS(pmcraid_host); /* host template structure for pmcraid driver */ static struct scsi_host_template pmcraid_host_template = { @@ -4126,7 +4127,7 @@ static struct scsi_host_template pmcraid_host_template = { .max_sectors = PMCRAID_IOA_MAX_SECTORS, .no_write_same = 1, .cmd_per_lun = PMCRAID_MAX_CMD_PER_LUN, - .shost_attrs = pmcraid_host_attrs, + .shost_groups = pmcraid_host_groups, .proc_name = PMCRAID_DRIVER_NAME, }; From patchwork Fri Oct 8 20:23:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546361 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1368DC433F5 for ; Fri, 8 Oct 2021 20:25:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F0DC661100 for ; Fri, 8 Oct 2021 20:25:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242880AbhJHU1S (ORCPT ); Fri, 8 Oct 2021 16:27:18 -0400 Received: from mail-pl1-f173.google.com ([209.85.214.173]:44873 "EHLO mail-pl1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242635AbhJHU1K (ORCPT ); Fri, 8 Oct 2021 16:27:10 -0400 Received: by mail-pl1-f173.google.com with SMTP id t11so6838122plq.11 for ; Fri, 08 Oct 2021 13:25:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ass/DDw+jAao+IjeSewlXwx/n01JkMuXZrSeajEp2NM=; b=1PmbaTj1T9iL+Eyg8/gScT8q2+6jzQCavYtMDESQca/kgMefsZjVOAXRolrGVRxE99 e8mHtBrF4SCmvwOSE9puzIEBxDuRrqTFYewouElJTTdnY4c6GkZJWmFvHwYFGE2jxAJH mfpPN9hFRyXOPc+P102qJghmIQioG1KAN7PryWLmJHmHKJXWOvhZv6/kaFR0Dup2TXme Qgl6p1ziw5PN/ZjpfBkaQUtzDM807Cj1GUuNvFEXKdKVAo8tzpTnqTgOdNCjIVXpM1LX rJMakMW4TXR+owm/VEqJpaop9i6prUn7V1ijB9gtaSWbG2hVS47aoq9F1Pl2paMwbplq N2iQ== X-Gm-Message-State: AOAM531yOzm07YQUSETVWr1+nHk7ErH0gxoNHMUH7SQN2t3kslJG4iZO Nxy5lpae3FJjyCDwdY+uzQQ= X-Google-Smtp-Source: ABdhPJyMj1dzIeTlmjayLSTX7qHcA4hs+XTMgfEmP+w8Wsp3F2XZx9blaBUKMwkz8t871ySl/Jw48A== X-Received: by 2002:a17:902:7d95:b0:13d:a304:1b55 with SMTP id a21-20020a1709027d9500b0013da3041b55mr11532627plm.51.1633724714562; Fri, 08 Oct 2021 13:25:14 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.25.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:25:14 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Saurav Kashyap , Javed Hasan , GR-QLogic-Storage-Upstream@marvell.com, "James E.J. Bottomley" Subject: [PATCH v3 37/46] scsi: qedf: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:44 -0700 Message-Id: <20211008202353.1448570-38-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/qedf/qedf.h | 2 +- drivers/scsi/qedf/qedf_attr.c | 15 ++++++++++++--- drivers/scsi/qedf/qedf_main.c | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/qedf/qedf.h b/drivers/scsi/qedf/qedf.h index ba94413fe2ea..4caddd6442f7 100644 --- a/drivers/scsi/qedf/qedf.h +++ b/drivers/scsi/qedf/qedf.h @@ -498,7 +498,7 @@ extern void qedf_process_abts_compl(struct qedf_ctx *qedf, struct fcoe_cqe *cqe, extern struct qedf_ioreq *qedf_alloc_cmd(struct qedf_rport *fcport, u8 cmd_type); -extern struct device_attribute *qedf_host_attrs[]; +extern const struct attribute_group *qedf_host_groups[]; extern void qedf_cmd_timer_set(struct qedf_ctx *qedf, struct qedf_ioreq *io_req, unsigned int timer_msec); extern int qedf_init_mp_req(struct qedf_ioreq *io_req); diff --git a/drivers/scsi/qedf/qedf_attr.c b/drivers/scsi/qedf/qedf_attr.c index 461c0c9180c4..fdc66d294813 100644 --- a/drivers/scsi/qedf/qedf_attr.c +++ b/drivers/scsi/qedf/qedf_attr.c @@ -60,12 +60,21 @@ static ssize_t fka_period_show(struct device *dev, static DEVICE_ATTR_RO(fcoe_mac); static DEVICE_ATTR_RO(fka_period); -struct device_attribute *qedf_host_attrs[] = { - &dev_attr_fcoe_mac, - &dev_attr_fka_period, +static struct attribute *qedf_host_attrs[] = { + &dev_attr_fcoe_mac.attr, + &dev_attr_fka_period.attr, NULL, }; +static const struct attribute_group qedf_host_attr_group = { + .attrs = qedf_host_attrs +}; + +const struct attribute_group *qedf_host_groups[] = { + &qedf_host_attr_group, + NULL +}; + extern const struct qed_fcoe_ops *qed_ops; void qedf_capture_grc_dump(struct qedf_ctx *qedf) diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index 42d0d941dba5..1eed6270e8f2 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -986,7 +986,7 @@ static struct scsi_host_template qedf_host_template = { .cmd_per_lun = 32, .max_sectors = 0xffff, .queuecommand = qedf_queuecommand, - .shost_attrs = qedf_host_attrs, + .shost_groups = qedf_host_groups, .eh_abort_handler = qedf_eh_abort, .eh_device_reset_handler = qedf_eh_device_reset, /* lun reset */ .eh_target_reset_handler = qedf_eh_target_reset, /* target reset */ From patchwork Fri Oct 8 20:23:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546363 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D4C0C4332F for ; Fri, 8 Oct 2021 20:25:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6893D61177 for ; Fri, 8 Oct 2021 20:25:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242913AbhJHU1T (ORCPT ); Fri, 8 Oct 2021 16:27:19 -0400 Received: from mail-pl1-f169.google.com ([209.85.214.169]:42974 "EHLO mail-pl1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242715AbhJHU1M (ORCPT ); Fri, 8 Oct 2021 16:27:12 -0400 Received: by mail-pl1-f169.google.com with SMTP id l6so6845840plh.9 for ; Fri, 08 Oct 2021 13:25:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0ZTBxLPqSs/6i0U7e7XZcvzD63NIy196LVs1TUn3088=; b=lDMQ3EzTOKG7gkoOdFBEvVdbZCbhM6IGnnFvr6W3hnRVZclg4aVv2HcX4+htCDipX7 GFlVqjNb7E3kLt7siq31egUEiowphzmXsbps++Mie5pMCLsEydIHxrTunEA6TnpSRbMc 6HxfXiKOdgv0yQ3aG0MMwUzgiVrIdsMlT2uxki3yDGkI6IbZwxsnfiPgbqVxsbpm5DtN XNxQJvi/aInyux8Gj1hPKduIEgw6TRUWDmgB7wabGXJh57FoAcP33zoeC4+ebhBpL2y8 IwRVHfU2jqpxvJK9+a8g9VVp76rrzm3RDDIdLEvRNC4yezJr23xtRXMYKE/++Z4N/ETw s0dw== X-Gm-Message-State: AOAM533BbYkTWgt4U2zpG8Ch7criroX8d+yhIEMVAB5lNvwKL5G0I8IK fpSKYJE3uEOqX+be/zQ+rkU= X-Google-Smtp-Source: ABdhPJygs5MWLmkhZYmRomdXXp00sa50NXeAr4UHBarg5E++dfMuE7GjRUyieD63hKKMhn4cOpvP7Q== X-Received: by 2002:a17:902:7ec2:b0:13d:b563:c39 with SMTP id p2-20020a1709027ec200b0013db5630c39mr11342957plb.14.1633724716109; Fri, 08 Oct 2021 13:25:16 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.25.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:25:15 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Nilesh Javali , Manish Rangankar , GR-QLogic-Storage-Upstream@marvell.com, "James E.J. Bottomley" Subject: [PATCH v3 38/46] scsi: qedi: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:45 -0700 Message-Id: <20211008202353.1448570-39-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/qedi/qedi_gbl.h | 2 +- drivers/scsi/qedi/qedi_iscsi.c | 2 +- drivers/scsi/qedi/qedi_sysfs.c | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/qedi/qedi_gbl.h b/drivers/scsi/qedi/qedi_gbl.h index 9f8e8ef405a1..72942772b198 100644 --- a/drivers/scsi/qedi/qedi_gbl.h +++ b/drivers/scsi/qedi/qedi_gbl.h @@ -22,7 +22,7 @@ extern struct iscsi_transport qedi_iscsi_transport; extern const struct qed_iscsi_ops *qedi_ops; extern const struct qedi_debugfs_ops qedi_debugfs_ops[]; extern const struct file_operations qedi_dbg_fops[]; -extern struct device_attribute *qedi_shost_attrs[]; +extern const struct attribute_group *qedi_shost_groups[]; int qedi_alloc_sq(struct qedi_ctx *qedi, struct qedi_endpoint *ep); void qedi_free_sq(struct qedi_ctx *qedi, struct qedi_endpoint *ep); diff --git a/drivers/scsi/qedi/qedi_iscsi.c b/drivers/scsi/qedi/qedi_iscsi.c index c5260429c637..88aa7d8b11c9 100644 --- a/drivers/scsi/qedi/qedi_iscsi.c +++ b/drivers/scsi/qedi/qedi_iscsi.c @@ -58,7 +58,7 @@ struct scsi_host_template qedi_host_template = { .max_sectors = 0xffff, .dma_boundary = QEDI_HW_DMA_BOUNDARY, .cmd_per_lun = 128, - .shost_attrs = qedi_shost_attrs, + .shost_groups = qedi_shost_groups, }; static void qedi_conn_free_login_resources(struct qedi_ctx *qedi, diff --git a/drivers/scsi/qedi/qedi_sysfs.c b/drivers/scsi/qedi/qedi_sysfs.c index be174d30eb7c..b00a7e08ef53 100644 --- a/drivers/scsi/qedi/qedi_sysfs.c +++ b/drivers/scsi/qedi/qedi_sysfs.c @@ -42,8 +42,17 @@ static ssize_t speed_show(struct device *dev, static DEVICE_ATTR_RO(port_state); static DEVICE_ATTR_RO(speed); -struct device_attribute *qedi_shost_attrs[] = { - &dev_attr_port_state, - &dev_attr_speed, +static struct attribute *qedi_shost_attrs[] = { + &dev_attr_port_state.attr, + &dev_attr_speed.attr, + NULL +}; + +static const struct attribute_group qedi_shost_attr_group = { + .attrs = qedi_shost_attrs +}; + +const struct attribute_group *qedi_shost_groups[] = { + &qedi_shost_attr_group, NULL }; From patchwork Fri Oct 8 20:23:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546365 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 338B7C43219 for ; Fri, 8 Oct 2021 20:25:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 201186112D for ; Fri, 8 Oct 2021 20:25:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242985AbhJHU1T (ORCPT ); Fri, 8 Oct 2021 16:27:19 -0400 Received: from mail-pg1-f179.google.com ([209.85.215.179]:45958 "EHLO mail-pg1-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242900AbhJHU1N (ORCPT ); Fri, 8 Oct 2021 16:27:13 -0400 Received: by mail-pg1-f179.google.com with SMTP id q12so3446075pgq.12 for ; Fri, 08 Oct 2021 13:25:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+zV95fuzcw/1F5E6I+0GGTqawzS1QjJLjxm6SJSTdxs=; b=bw30OelT86roJxCjTbySa+uQw5oFMDhqw1NJmVF0ujVzGouGeofcm6hQFM7c4zjlCq Ci+Y/c0FVMBTELJa98zc6S4vky3DKKvSbcXX4R1DvYbjQlJ33c55iFwAuuuWTFLERHSJ 4DbmUxXRQGQy2O8uzYfbNsPaygFcSHUyckoaHKf0ClakZVtknygRbbxsILMda3bEAU/6 jBAs7AeuF5IN+lhfIDISkYBUTrZcU1EmGhPCML38DPF1hzla+mDM7OZzTcecyZZOq8pX wGeM2iIZOFGeRUrwasRfIoklo8/n5k0Q4WvyAHxEduIukm+D8YNazsis5BASzT+gg9ra m0iw== X-Gm-Message-State: AOAM532vwz6BVnsgtMJumOuDIAmtZRpCPpNp29VoA8S0TKkkfw7oIOap sfdW4u4XrCm9a2K+RWVBGMw= X-Google-Smtp-Source: ABdhPJyTHGpxQlDEs8oOyBGGRD/05+IOd0AJC7wR3lQZCER0oV7mDqXAd6EK1y13PVzTwaNqmCgP6A== X-Received: by 2002:a63:4f25:: with SMTP id d37mr6479530pgb.61.1633724717543; Fri, 08 Oct 2021 13:25:17 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.25.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:25:17 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Nilesh Javali , GR-QLogic-Storage-Upstream@marvell.com, "James E.J. Bottomley" Subject: [PATCH v3 39/46] scsi: qla2xxx: Remove a declaration Date: Fri, 8 Oct 2021 13:23:46 -0700 Message-Id: <20211008202353.1448570-40-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Since there is no definition for the qla2x00_host_attrs_dm array, remove its declaration. Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_gbl.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index 8aadcdeca6cb..5ff974e98783 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -743,7 +743,6 @@ uint qla25xx_fdmi_port_speed_currently(struct qla_hw_data *); */ struct device_attribute; extern struct device_attribute *qla2x00_host_attrs[]; -extern struct device_attribute *qla2x00_host_attrs_dm[]; struct fc_function_template; extern struct fc_function_template qla2xxx_transport_functions; extern struct fc_function_template qla2xxx_transport_vport_functions; From patchwork Fri Oct 8 20:23:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546367 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF9D2C433F5 for ; Fri, 8 Oct 2021 20:25:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC0876112D for ; Fri, 8 Oct 2021 20:25:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231997AbhJHU1W (ORCPT ); Fri, 8 Oct 2021 16:27:22 -0400 Received: from mail-pj1-f49.google.com ([209.85.216.49]:41713 "EHLO mail-pj1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242932AbhJHU1O (ORCPT ); Fri, 8 Oct 2021 16:27:14 -0400 Received: by mail-pj1-f49.google.com with SMTP id na16-20020a17090b4c1000b0019f5bb661f9so8690166pjb.0 for ; Fri, 08 Oct 2021 13:25:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QTnF5gt79yfShYmIj/Qb98P/ruNGoWUDt3/89FDnMdE=; b=rTdbP+gY2CcgILp1RmpvVddp+JIc08ZKvDcMgmj1BdkOA+H0tCxIRpQCSV8re87bVJ j1AQ3v84UZDpuiwYKIR0BIpsK0WpLF72pYlhat29cM2kVPoKeYZCaylpUEwa06gpZf02 9137UnI8DxWHOwKVF7qmxbM5ZeyQHlyJDYtAcb3I1RUuv8CZa1SUA7jhr4FG8Uq7FlD6 7YqgT/aEhRmOqXB7M2+zb50ksn8hKVQ/iRZmYS7xY3ux3hQsdthndFEH8YbQL4kzGHGW Mq1pI5K7UgNPUyswK5Aq3YycrP2I7Gwrc/fj6LlU3mD4sry+NbPbMnQ/KsvjBDrSyMID MGSw== X-Gm-Message-State: AOAM531HleuBC/eueDJi/5SmUFDAD92wHMUZuGFDjMlLHGBr+v9b0jHc wCyDDCmGBCf0H0KWq4VIuNM= X-Google-Smtp-Source: ABdhPJxp6rUjTaU/g6N9AIpPYXPrW5doF7u4gIpEdYXLe8DQPdTncjaZxZ/lx3sMffPFfDlhpSvZPQ== X-Received: by 2002:a17:902:a38b:b0:138:d329:27ac with SMTP id x11-20020a170902a38b00b00138d32927acmr11268069pla.7.1633724719071; Fri, 08 Oct 2021 13:25:19 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.25.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:25:18 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Nilesh Javali , GR-QLogic-Storage-Upstream@marvell.com, "James E.J. Bottomley" Subject: [PATCH v3 40/46] scsi: qla2xxx: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:47 -0700 Message-Id: <20211008202353.1448570-41-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Additionally, remove qla_insert_tgt_attrs() and replace it with qla_host_attr_is_visible(). Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_attr.c | 118 +++++++++++++++++--------------- drivers/scsi/qla2xxx/qla_gbl.h | 3 +- drivers/scsi/qla2xxx/qla_os.c | 5 +- 3 files changed, 63 insertions(+), 63 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index cb5f2ecb652d..cc271d744547 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -2481,72 +2481,76 @@ static DEVICE_ATTR(port_no, 0444, qla2x00_port_no_show, NULL); static DEVICE_ATTR(fw_attr, 0444, qla2x00_fw_attr_show, NULL); static DEVICE_ATTR_RO(edif_doorbell); - -struct device_attribute *qla2x00_host_attrs[] = { - &dev_attr_driver_version, - &dev_attr_fw_version, - &dev_attr_serial_num, - &dev_attr_isp_name, - &dev_attr_isp_id, - &dev_attr_model_name, - &dev_attr_model_desc, - &dev_attr_pci_info, - &dev_attr_link_state, - &dev_attr_zio, - &dev_attr_zio_timer, - &dev_attr_beacon, - &dev_attr_beacon_config, - &dev_attr_optrom_bios_version, - &dev_attr_optrom_efi_version, - &dev_attr_optrom_fcode_version, - &dev_attr_optrom_fw_version, - &dev_attr_84xx_fw_version, - &dev_attr_total_isp_aborts, - &dev_attr_serdes_version, - &dev_attr_mpi_version, - &dev_attr_phy_version, - &dev_attr_flash_block_size, - &dev_attr_vlan_id, - &dev_attr_vn_port_mac_address, - &dev_attr_fabric_param, - &dev_attr_fw_state, - &dev_attr_optrom_gold_fw_version, - &dev_attr_thermal_temp, - &dev_attr_diag_requests, - &dev_attr_diag_megabytes, - &dev_attr_fw_dump_size, - &dev_attr_allow_cna_fw_dump, - &dev_attr_pep_version, - &dev_attr_min_supported_speed, - &dev_attr_max_supported_speed, - &dev_attr_zio_threshold, - &dev_attr_dif_bundle_statistics, - &dev_attr_port_speed, - &dev_attr_port_no, - &dev_attr_fw_attr, - &dev_attr_dport_diagnostics, - &dev_attr_edif_doorbell, - &dev_attr_mpi_pause, +static struct attribute *qla2x00_host_attrs[] = { + &dev_attr_driver_version.attr, + &dev_attr_fw_version.attr, + &dev_attr_serial_num.attr, + &dev_attr_isp_name.attr, + &dev_attr_isp_id.attr, + &dev_attr_model_name.attr, + &dev_attr_model_desc.attr, + &dev_attr_pci_info.attr, + &dev_attr_link_state.attr, + &dev_attr_zio.attr, + &dev_attr_zio_timer.attr, + &dev_attr_beacon.attr, + &dev_attr_beacon_config.attr, + &dev_attr_optrom_bios_version.attr, + &dev_attr_optrom_efi_version.attr, + &dev_attr_optrom_fcode_version.attr, + &dev_attr_optrom_fw_version.attr, + &dev_attr_84xx_fw_version.attr, + &dev_attr_total_isp_aborts.attr, + &dev_attr_serdes_version.attr, + &dev_attr_mpi_version.attr, + &dev_attr_phy_version.attr, + &dev_attr_flash_block_size.attr, + &dev_attr_vlan_id.attr, + &dev_attr_vn_port_mac_address.attr, + &dev_attr_fabric_param.attr, + &dev_attr_fw_state.attr, + &dev_attr_optrom_gold_fw_version.attr, + &dev_attr_thermal_temp.attr, + &dev_attr_diag_requests.attr, + &dev_attr_diag_megabytes.attr, + &dev_attr_fw_dump_size.attr, + &dev_attr_allow_cna_fw_dump.attr, + &dev_attr_pep_version.attr, + &dev_attr_min_supported_speed.attr, + &dev_attr_max_supported_speed.attr, + &dev_attr_zio_threshold.attr, + &dev_attr_dif_bundle_statistics.attr, + &dev_attr_port_speed.attr, + &dev_attr_port_no.attr, + &dev_attr_fw_attr.attr, + &dev_attr_dport_diagnostics.attr, + &dev_attr_edif_doorbell.attr, + &dev_attr_mpi_pause.attr, NULL, /* reserve for qlini_mode */ NULL, /* reserve for ql2xiniexchg */ NULL, /* reserve for ql2xexchoffld */ NULL, }; -void qla_insert_tgt_attrs(void) +static umode_t qla_host_attr_is_visible(struct kobject *kobj, + struct attribute *attr, int i) { - struct device_attribute **attr; + if (attr == &dev_attr_qlini_mode.attr || + attr == &dev_attr_ql2xiniexchg.attr || + attr == &dev_attr_ql2xexchoffld.attr) + return ql2x_ini_mode == QLA2XXX_INI_MODE_DUAL ? attr->mode : 0; + return attr->mode; +} - /* advance to empty slot */ - for (attr = &qla2x00_host_attrs[0]; *attr; ++attr) - continue; +static const struct attribute_group qla2x00_host_attr_group = { + .is_visible = qla_host_attr_is_visible, + .attrs = qla2x00_host_attrs +}; - *attr = &dev_attr_qlini_mode; - attr++; - *attr = &dev_attr_ql2xiniexchg; - attr++; - *attr = &dev_attr_ql2xexchoffld; -} +const struct attribute_group *qla2x00_host_groups[] = { + &qla2x00_host_attr_group, + NULL +}; /* Host attributes. */ diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index 5ff974e98783..3c4fa8bac88d 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -742,7 +742,7 @@ uint qla25xx_fdmi_port_speed_currently(struct qla_hw_data *); * Global Function Prototypes in qla_attr.c source file. */ struct device_attribute; -extern struct device_attribute *qla2x00_host_attrs[]; +extern const struct attribute_group *qla2x00_host_groups[]; struct fc_function_template; extern struct fc_function_template qla2xxx_transport_functions; extern struct fc_function_template qla2xxx_transport_vport_functions; @@ -756,7 +756,6 @@ extern int qla2x00_echo_test(scsi_qla_host_t *, extern int qla24xx_update_all_fcp_prio(scsi_qla_host_t *); extern int qla24xx_fcp_prio_cfg_valid(scsi_qla_host_t *, struct qla_fcp_prio_cfg *, uint8_t); -void qla_insert_tgt_attrs(void); /* * Global Function Prototypes in qla_dfs.c source file. */ diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 03ff2596715b..4f828ce25b25 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -7943,7 +7943,7 @@ struct scsi_host_template qla2xxx_driver_template = { .sg_tablesize = SG_ALL, .max_sectors = 0xFFFF, - .shost_attrs = qla2x00_host_attrs, + .shost_groups = qla2x00_host_groups, .supported_mode = MODE_INITIATOR, .track_queue_depth = 1, @@ -8131,9 +8131,6 @@ qla2x00_module_init(void) if (ql2xextended_error_logging == 1) ql2xextended_error_logging = QL_DBG_DEFAULT1_MASK; - if (ql2x_ini_mode == QLA2XXX_INI_MODE_DUAL) - qla_insert_tgt_attrs(); - qla2xxx_transport_template = fc_attach_transport(&qla2xxx_transport_functions); if (!qla2xxx_transport_template) { From patchwork Fri Oct 8 20:23:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546369 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A05B2C433EF for ; Fri, 8 Oct 2021 20:25:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8C4F761100 for ; Fri, 8 Oct 2021 20:25:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242741AbhJHU1X (ORCPT ); Fri, 8 Oct 2021 16:27:23 -0400 Received: from mail-pl1-f179.google.com ([209.85.214.179]:46784 "EHLO mail-pl1-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242279AbhJHU1Q (ORCPT ); Fri, 8 Oct 2021 16:27:16 -0400 Received: by mail-pl1-f179.google.com with SMTP id 21so676126plo.13 for ; Fri, 08 Oct 2021 13:25:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=upj/KnYLoS9C7cnMr4Y0XwV/YgR2WUy46bqjINgNPoI=; b=nszBSxDmjxaLFtGZ0sGEoxCcMFs7EKZgpIvly9q803XBv0tN3BmAlvsNzM7vk0Zn5X /Vm68YCcEbXNVFcz6mYqysf+Cn5Tzv6mW8iLKgLZbfvPcPEWElfK/ZZG9bZ2BU7GGO8u y+HtIQgXr6hK+LViOKY2T5AeyBd9Wzb4i3HxY15xy1VY/k7O+iBQYmOxpSEKu/rFn+xg sdHQamImjCApEFskTB4Bg9kr9Dk6HaOzVAT57DEfVcjBqjJD3XBH7QZU6CVvG52lLAmG iSZ5VkXLdR2BLsiCjLkLs61LK2MU5rhYbe3ZPu/re0g0DHJ4YMMQJ6RAPQubWK8BfR0f mZ9A== X-Gm-Message-State: AOAM530PeIdeT9e10NOR+qy/r98ot0EHb6wwhDuEXUTVRktZBJUYT9kO EIJheRL5XY6s8UvOrt8dvvhzf2OUvLBEnA== X-Google-Smtp-Source: ABdhPJwKXAWk4nKWGeEZ97imi2KJTaqhDVns90Ym3mjywrjhXm+WsB6CjLhDqofsL56hKpnPPp4rOA== X-Received: by 2002:a17:902:8495:b0:13e:6a01:f5fb with SMTP id c21-20020a170902849500b0013e6a01f5fbmr11292293plo.61.1633724720621; Fri, 08 Oct 2021 13:25:20 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.25.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:25:20 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Nilesh Javali , Manish Rangankar , GR-QLogic-Storage-Upstream@marvell.com, "James E.J. Bottomley" Subject: [PATCH v3 41/46] scsi: qla4xxx: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:48 -0700 Message-Id: <20211008202353.1448570-42-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/qla4xxx/ql4_attr.c | 41 ++++++++++++++++++++------------- drivers/scsi/qla4xxx/ql4_glbl.h | 3 ++- drivers/scsi/qla4xxx/ql4_os.c | 2 +- 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/drivers/scsi/qla4xxx/ql4_attr.c b/drivers/scsi/qla4xxx/ql4_attr.c index ec4352818fbf..abfa6ef60480 100644 --- a/drivers/scsi/qla4xxx/ql4_attr.c +++ b/drivers/scsi/qla4xxx/ql4_attr.c @@ -330,21 +330,30 @@ static DEVICE_ATTR(fw_ext_timestamp, S_IRUGO, qla4xxx_fw_ext_timestamp_show, static DEVICE_ATTR(fw_load_src, S_IRUGO, qla4xxx_fw_load_src_show, NULL); static DEVICE_ATTR(fw_uptime, S_IRUGO, qla4xxx_fw_uptime_show, NULL); -struct device_attribute *qla4xxx_host_attrs[] = { - &dev_attr_fw_version, - &dev_attr_serial_num, - &dev_attr_iscsi_version, - &dev_attr_optrom_version, - &dev_attr_board_id, - &dev_attr_fw_state, - &dev_attr_phy_port_cnt, - &dev_attr_phy_port_num, - &dev_attr_iscsi_func_cnt, - &dev_attr_hba_model, - &dev_attr_fw_timestamp, - &dev_attr_fw_build_user, - &dev_attr_fw_ext_timestamp, - &dev_attr_fw_load_src, - &dev_attr_fw_uptime, +static struct attribute *qla4xxx_host_attrs[] = { + &dev_attr_fw_version.attr, + &dev_attr_serial_num.attr, + &dev_attr_iscsi_version.attr, + &dev_attr_optrom_version.attr, + &dev_attr_board_id.attr, + &dev_attr_fw_state.attr, + &dev_attr_phy_port_cnt.attr, + &dev_attr_phy_port_num.attr, + &dev_attr_iscsi_func_cnt.attr, + &dev_attr_hba_model.attr, + &dev_attr_fw_timestamp.attr, + &dev_attr_fw_build_user.attr, + &dev_attr_fw_ext_timestamp.attr, + &dev_attr_fw_load_src.attr, + &dev_attr_fw_uptime.attr, NULL, }; + +static const struct attribute_group qla4xxx_host_attr_group = { + .attrs = qla4xxx_host_attrs +}; + +const struct attribute_group *qla4xxx_host_groups[] = { + &qla4xxx_host_attr_group, + NULL +}; diff --git a/drivers/scsi/qla4xxx/ql4_glbl.h b/drivers/scsi/qla4xxx/ql4_glbl.h index ea60057b2e20..c0873381508d 100644 --- a/drivers/scsi/qla4xxx/ql4_glbl.h +++ b/drivers/scsi/qla4xxx/ql4_glbl.h @@ -286,5 +286,6 @@ extern int ql4xenablemsix; extern int ql4xmdcapmask; extern int ql4xenablemd; -extern struct device_attribute *qla4xxx_host_attrs[]; +extern const struct attribute_group *qla4xxx_host_groups[]; + #endif /* _QLA4x_GBL_H */ diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index f1ea65c6e5f5..d0cf7d1a364e 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c @@ -241,7 +241,7 @@ static struct scsi_host_template qla4xxx_driver_template = { .sg_tablesize = SG_ALL, .max_sectors = 0xFFFF, - .shost_attrs = qla4xxx_host_attrs, + .shost_groups = qla4xxx_host_groups, .host_reset = qla4xxx_host_reset, .vendor_id = SCSI_NL_VID_TYPE_PCI | PCI_VENDOR_ID_QLOGIC, }; From patchwork Fri Oct 8 20:23:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546371 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4ED07C433F5 for ; Fri, 8 Oct 2021 20:25:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3827E6112D for ; Fri, 8 Oct 2021 20:25:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242978AbhJHU1Y (ORCPT ); Fri, 8 Oct 2021 16:27:24 -0400 Received: from mail-pl1-f178.google.com ([209.85.214.178]:36657 "EHLO mail-pl1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242800AbhJHU1S (ORCPT ); Fri, 8 Oct 2021 16:27:18 -0400 Received: by mail-pl1-f178.google.com with SMTP id k8so1440377pls.3 for ; Fri, 08 Oct 2021 13:25:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Znd2qZV0vS99jLjSB0zn46RpnpMii7+G/Fr87UH6vgU=; b=6WJpS18a7ZPy5YAv7qXXY45gmWsQ5XY9blHnX8yLyVoQH/IctSFzLTyjKu5QHMF9n4 TKIc9kGuRyitlKfhVu8o7v/nawYJDMTYti9pj+5MsI2euT7WFmkQ6BM2h4SJrAWF+aOY NP+AAhWiGdBQy/n744yqQOXUBp9wOg4o/kewCR7k13i/SOM7viyUbZvaJoEg74CYWKkH k98Qm8oLyovcKMDLnsT7ZT782vURTtF2wHqzAva6fnN7kqU6BnpZQzY6/8PNhydkUwUH wx6qS8U12ZmFAXIoBGAzW3S2hDdCoDrketop54DREImlJhE7QSMKMFknSNKo8BUNhm4O dE/Q== X-Gm-Message-State: AOAM533q7XM25AzOAClxzx4/CYMh+MHy7oWwg1bsSkPmvFsfXvRKlqs0 qrUs3+sZ7RPaP5+1DGJSCrk= X-Google-Smtp-Source: ABdhPJwKZt9hswnkc62nPcHp5Bwgk2SXt8PUk+i+cnERv2g7lXwrhEBrQfnEnU6CdCo1IswVsId7Tg== X-Received: by 2002:a17:903:1207:b0:138:e2f9:6c98 with SMTP id l7-20020a170903120700b00138e2f96c98mr11697315plh.11.1633724722013; Fri, 08 Oct 2021 13:25:22 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.25.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:25:21 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Don Brace , "James E.J. Bottomley" Subject: [PATCH v3 42/46] scsi: smartpqi: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:49 -0700 Message-Id: <20211008202353.1448570-43-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/smartpqi/smartpqi_init.c | 46 +++++++++++++++------------ 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index b966ce3b4385..6a6a83331ef0 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -6847,20 +6847,22 @@ static DEVICE_ATTR(enable_r5_writes, 0644, static DEVICE_ATTR(enable_r6_writes, 0644, pqi_host_enable_r6_writes_show, pqi_host_enable_r6_writes_store); -static struct device_attribute *pqi_shost_attrs[] = { - &dev_attr_driver_version, - &dev_attr_firmware_version, - &dev_attr_model, - &dev_attr_serial_number, - &dev_attr_vendor, - &dev_attr_rescan, - &dev_attr_lockup_action, - &dev_attr_enable_stream_detection, - &dev_attr_enable_r5_writes, - &dev_attr_enable_r6_writes, +static struct attribute *pqi_shost_attrs[] = { + &dev_attr_driver_version.attr, + &dev_attr_firmware_version.attr, + &dev_attr_model.attr, + &dev_attr_serial_number.attr, + &dev_attr_vendor.attr, + &dev_attr_rescan.attr, + &dev_attr_lockup_action.attr, + &dev_attr_enable_stream_detection.attr, + &dev_attr_enable_r5_writes.attr, + &dev_attr_enable_r6_writes.attr, NULL }; +ATTRIBUTE_GROUPS(pqi_shost); + static ssize_t pqi_unique_id_show(struct device *dev, struct device_attribute *attr, char *buffer) { @@ -7129,17 +7131,19 @@ static DEVICE_ATTR(ssd_smart_path_enabled, 0444, pqi_ssd_smart_path_enabled_show static DEVICE_ATTR(raid_level, 0444, pqi_raid_level_show, NULL); static DEVICE_ATTR(raid_bypass_cnt, 0444, pqi_raid_bypass_cnt_show, NULL); -static struct device_attribute *pqi_sdev_attrs[] = { - &dev_attr_lunid, - &dev_attr_unique_id, - &dev_attr_path_info, - &dev_attr_sas_address, - &dev_attr_ssd_smart_path_enabled, - &dev_attr_raid_level, - &dev_attr_raid_bypass_cnt, +static struct attribute *pqi_sdev_attrs[] = { + &dev_attr_lunid.attr, + &dev_attr_unique_id.attr, + &dev_attr_path_info.attr, + &dev_attr_sas_address.attr, + &dev_attr_ssd_smart_path_enabled.attr, + &dev_attr_raid_level.attr, + &dev_attr_raid_bypass_cnt.attr, NULL }; +ATTRIBUTE_GROUPS(pqi_sdev); + static struct scsi_host_template pqi_driver_template = { .module = THIS_MODULE, .name = DRIVER_NAME_SHORT, @@ -7153,8 +7157,8 @@ static struct scsi_host_template pqi_driver_template = { .slave_alloc = pqi_slave_alloc, .slave_configure = pqi_slave_configure, .map_queues = pqi_map_queues, - .sdev_attrs = pqi_sdev_attrs, - .shost_attrs = pqi_shost_attrs, + .sdev_groups = pqi_sdev_groups, + .shost_groups = pqi_shost_groups, }; static int pqi_register_scsi(struct pqi_ctrl_info *ctrl_info) From patchwork Fri Oct 8 20:23:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546373 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3F9DC433F5 for ; Fri, 8 Oct 2021 20:25:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C7FE961100 for ; Fri, 8 Oct 2021 20:25:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242910AbhJHU1a (ORCPT ); Fri, 8 Oct 2021 16:27:30 -0400 Received: from mail-pf1-f180.google.com ([209.85.210.180]:45933 "EHLO mail-pf1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242700AbhJHU1T (ORCPT ); Fri, 8 Oct 2021 16:27:19 -0400 Received: by mail-pf1-f180.google.com with SMTP id i65so6153032pfe.12 for ; Fri, 08 Oct 2021 13:25:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jCg2eGQ4g3QgDwVGpIZogGbCNCN5Pmyt9wpBQepzDsI=; b=GX+xLH9igKsvK605c3LoqUjxBa4i1OJdqc1xuDLxu8o2gTNWuhIrWOjTciksgdD2b/ BGkzuSF2gQxOh9UvWUQHM4PBfZ39mh8ZFtmpqRZmo6JJg/XqVkgKlQYgMmlKsTKANrkH WsNZLCl/psku6UlawmmaUZKFzRd06uQURjnr3dPqCn3+Uyv7HVZ4NSQfLxdyBtzNx+SK Ifx1wha6OI6njO8id7WdjjJ6B3yqNHAYiRNjUEyX/qout2JFNGbIe4eOQahUWmHCqYBy 3W2ERgZ3yUrC47MdS7v8IYsz2p3r40Pse4d/RWe2j5lKX573UNHrk9QaKc+hcr9F7JmI uRSg== X-Gm-Message-State: AOAM53204T5IRSlDbEA6+4BtDVcLfM+BYVmUcrMeFwglFfXt4oy0KbJv RQ+gv632u2B1HGq3C49eFJIo4oxvfCPTLw== X-Google-Smtp-Source: ABdhPJzY+mAbHbBUvrADIm+wgHXGFt7B5zverKzk04dthse8XnVHhRRAZfi11puMlk9v4rgtrR7MFg== X-Received: by 2002:a63:e002:: with SMTP id e2mr6280156pgh.386.1633724723509; Fri, 08 Oct 2021 13:25:23 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.25.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:25:23 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Karan Tilak Kumar , Sesidhar Baddela , "James E.J. Bottomley" Subject: [PATCH v3 43/46] scsi: snic: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:50 -0700 Message-Id: <20211008202353.1448570-44-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche --- drivers/scsi/snic/snic.h | 2 +- drivers/scsi/snic/snic_attrs.c | 19 ++++++++++++++----- drivers/scsi/snic/snic_main.c | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/snic/snic.h b/drivers/scsi/snic/snic.h index f4c666285bba..4ec7e30678e1 100644 --- a/drivers/scsi/snic/snic.h +++ b/drivers/scsi/snic/snic.h @@ -374,7 +374,7 @@ int snic_glob_init(void); void snic_glob_cleanup(void); extern struct workqueue_struct *snic_event_queue; -extern struct device_attribute *snic_attrs[]; +extern const struct attribute_group *snic_host_groups[]; int snic_queuecommand(struct Scsi_Host *, struct scsi_cmnd *); int snic_abort_cmd(struct scsi_cmnd *); diff --git a/drivers/scsi/snic/snic_attrs.c b/drivers/scsi/snic/snic_attrs.c index 32d5d556b6f8..dc03ce1ec909 100644 --- a/drivers/scsi/snic/snic_attrs.c +++ b/drivers/scsi/snic/snic_attrs.c @@ -68,10 +68,19 @@ static DEVICE_ATTR(snic_state, S_IRUGO, snic_show_state, NULL); static DEVICE_ATTR(drv_version, S_IRUGO, snic_show_drv_version, NULL); static DEVICE_ATTR(link_state, S_IRUGO, snic_show_link_state, NULL); -struct device_attribute *snic_attrs[] = { - &dev_attr_snic_sym_name, - &dev_attr_snic_state, - &dev_attr_drv_version, - &dev_attr_link_state, +static struct attribute *snic_host_attrs[] = { + &dev_attr_snic_sym_name.attr, + &dev_attr_snic_state.attr, + &dev_attr_drv_version.attr, + &dev_attr_link_state.attr, NULL, }; + +static const struct attribute_group snic_host_attr_group = { + .attrs = snic_host_attrs +}; + +const struct attribute_group *snic_host_groups[] = { + &snic_host_attr_group, + NULL +}; diff --git a/drivers/scsi/snic/snic_main.c b/drivers/scsi/snic/snic_main.c index 14f4ce665e58..29d56396058c 100644 --- a/drivers/scsi/snic/snic_main.c +++ b/drivers/scsi/snic/snic_main.c @@ -129,7 +129,7 @@ static struct scsi_host_template snic_host_template = { .can_queue = SNIC_MAX_IO_REQ, .sg_tablesize = SNIC_MAX_SG_DESC_CNT, .max_sectors = 0x800, - .shost_attrs = snic_attrs, + .shost_groups = snic_host_groups, .track_queue_depth = 1, .cmd_size = sizeof(struct snic_internal_io_state), .proc_name = "snic_scsi", From patchwork Fri Oct 8 20:23:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546379 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A9F7C433FE for ; Fri, 8 Oct 2021 20:25:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 84601610E7 for ; Fri, 8 Oct 2021 20:25:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243017AbhJHU1e (ORCPT ); Fri, 8 Oct 2021 16:27:34 -0400 Received: from mail-pj1-f44.google.com ([209.85.216.44]:42927 "EHLO mail-pj1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242279AbhJHU1Y (ORCPT ); Fri, 8 Oct 2021 16:27:24 -0400 Received: by mail-pj1-f44.google.com with SMTP id nn3-20020a17090b38c300b001a03bb6c4ebso6183100pjb.1 for ; Fri, 08 Oct 2021 13:25:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gKfpQzpGvviquOa/5ScRBq5qSCTQ056PvQuLg3pgnrM=; b=uJPw1VZV10lN7nbQvOB+8JxUYK9c5fnvfg1zoqF/OMvmkxgmo1yXMuYNKFN4iCgBMg jh95poEeAhwpWHon4KewXEBktsF9ViO+OX+rVzziz56ICapDC3yZfOdX0glWJR4EiRcG c3dMiPo+M52BKO1I1meD0ErJxdjuI5o5pwtza3g69DQGFI6fLIgV3YRtRBzgFNNoDQVu px6BzU5NbLYyxFy/L6amEVUeWN7TwFZLVwwTc5guzvmClHyMXikp/OVv9nVqH+ttyq/2 pUg6XWoxt8jnpwJBdU2yGgtMsWSwHarjfMOq1DHEaFRFgTzCYXmdeSnP6Klqi2cr1BdI KtSQ== X-Gm-Message-State: AOAM530Qg8MPtrxD7TaZ4DA9/PpO7RWK74NHMZAUGtx92AsdvpEhDxQY FYFLzGLh3af8kDJ/IwdW/JY= X-Google-Smtp-Source: ABdhPJySMrW0ssjWCQRhqwLEQJQghIgyJobtj8hP/a6kkyu2/a2FjXJBuWZnYmRKLyCOItShqexwRg== X-Received: by 2002:a17:90a:6289:: with SMTP id d9mr14973522pjj.110.1633724728117; Fri, 08 Oct 2021 13:25:28 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.25.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:25:27 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , David Kershner , Greg Kroah-Hartman , Dan Carpenter , Song Chen , "Fabio M. De Francesco" Subject: [PATCH v3 44/46] scsi: unisys: Remove the shost_attrs member Date: Fri, 8 Oct 2021 13:23:51 -0700 Message-Id: <20211008202353.1448570-45-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This patch prepares for removal of the shost_attrs member from struct scsi_host_template. Signed-off-by: Bart Van Assche Acked-by: David Kershner Acked-by: Greg Kroah-Hartman --- drivers/staging/unisys/visorhba/visorhba_main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c b/drivers/staging/unisys/visorhba/visorhba_main.c index 41f8a72a2a95..f0c647b97354 100644 --- a/drivers/staging/unisys/visorhba/visorhba_main.c +++ b/drivers/staging/unisys/visorhba/visorhba_main.c @@ -584,7 +584,6 @@ static struct scsi_host_template visorhba_driver_template = { .eh_device_reset_handler = visorhba_device_reset_handler, .eh_bus_reset_handler = visorhba_bus_reset_handler, .eh_host_reset_handler = visorhba_host_reset_handler, - .shost_attrs = NULL, #define visorhba_MAX_CMNDS 128 .can_queue = visorhba_MAX_CMNDS, .sg_tablesize = 64, From patchwork Fri Oct 8 20:23:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546377 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB84AC433EF for ; Fri, 8 Oct 2021 20:25:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D696261073 for ; Fri, 8 Oct 2021 20:25:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242946AbhJHU1c (ORCPT ); Fri, 8 Oct 2021 16:27:32 -0400 Received: from mail-pl1-f175.google.com ([209.85.214.175]:38624 "EHLO mail-pl1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243024AbhJHU1Z (ORCPT ); Fri, 8 Oct 2021 16:27:25 -0400 Received: by mail-pl1-f175.google.com with SMTP id x4so6894511pln.5 for ; Fri, 08 Oct 2021 13:25:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+/bp3hoiETw2P+T0Y2HtzrA38s9n3zqaqtEphrpxGKM=; b=EEf7PfeHgr7/3FXuw6VolXGxySwaRDqB9vuVMsz9NpqOUyq82oPv88fitqvM/1lTaZ +bzcWQVn1OJ3JbwlBoQT/l7VsdiX8C3cDFmG4LzGRn9aZMDMdLWsaGy8y1azx2u7aptO tJKctGU0mEHJj5cBX3V/KHxgF9APSKP9byS+thazR1YZx84McokkcKWYE1l57/82Zs2o /6dwXJDIbiXyAulLLng6ilbZYc6A2UoDrjz95dBgf7vDpCq2ymW/LCAZ7ICfEg/KlF4O 05pkTPf+F+Qlk6xnuwURg1AeDQZ4ONlClirTSQKP97CYJ80wTjM5fWNhV4CNZFjSD9ty gugQ== X-Gm-Message-State: AOAM533sNJqCrIfZwfpiiga3mfRZqX5EK6z2E1pjDYIVVdc5VtcDao2Q wJMq96S/WXz5IsumUW1mzBI= X-Google-Smtp-Source: ABdhPJycmj5b2RfCx7fxQDyPbT1Dfa+P2lACh3wfi/SkiU8xr24M/2PsLRINgVJX4JRM+skDKArgRw== X-Received: by 2002:a17:90b:1bcc:: with SMTP id oa12mr13844035pjb.212.1633724729532; Fri, 08 Oct 2021 13:25:29 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.25.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:25:29 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Alan Stern , Greg Kroah-Hartman Subject: [PATCH v3 45/46] scsi: usb: Switch to attribute groups Date: Fri, 8 Oct 2021 13:23:52 -0700 Message-Id: <20211008202353.1448570-46-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org struct device supports attribute groups directly but does not support struct device_attribute directly. Hence switch to attribute groups. Signed-off-by: Bart Van Assche Acked-by: Greg Kroah-Hartman --- drivers/usb/storage/scsiglue.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index e5a971b83e3f..4e5a928f0368 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c @@ -588,11 +588,13 @@ static ssize_t max_sectors_store(struct device *dev, struct device_attribute *at } static DEVICE_ATTR_RW(max_sectors); -static struct device_attribute *sysfs_device_attr_list[] = { - &dev_attr_max_sectors, +static struct attribute *usb_sdev_attrs[] = { + &dev_attr_max_sectors.attr, NULL, }; +ATTRIBUTE_GROUPS(usb_sdev); + /* * this defines our host template, with which we'll allocate hosts */ @@ -653,7 +655,7 @@ static const struct scsi_host_template usb_stor_host_template = { .skip_settle_delay = 1, /* sysfs device attributes */ - .sdev_attrs = sysfs_device_attr_list, + .sdev_groups = usb_sdev_groups, /* module management */ .module = THIS_MODULE From patchwork Fri Oct 8 20:23:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 12546375 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F25CC433FE for ; Fri, 8 Oct 2021 20:25:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 63C1D61100 for ; Fri, 8 Oct 2021 20:25:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242800AbhJHU1b (ORCPT ); Fri, 8 Oct 2021 16:27:31 -0400 Received: from mail-pl1-f172.google.com ([209.85.214.172]:36659 "EHLO mail-pl1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243027AbhJHU10 (ORCPT ); Fri, 8 Oct 2021 16:27:26 -0400 Received: by mail-pl1-f172.google.com with SMTP id k8so1440564pls.3 for ; Fri, 08 Oct 2021 13:25:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zRZkSfeTymcwyw907t2wyI9vj50Y1Nohnx58Np7XFFM=; b=v13ZVOHjasySoqJNj7X7bCUj+8QtdSRLzw+rwxS/oTwqn95FY0W6kL11Gf+IcWC6Dx iDDVTKXxbyYF1YzwMitAVQX6lxmidRqpLvIkJNpTt4yqTG+dnMoVKsX9zxvSiLKP/N4X 06cL6KGxzKv2RS4HeOp3lXgAfbq2CbluQEMg1QxNy9jOCErgKjO2Jsiu5KDsvAJQQJUg 4mPq1j0m3Vzem/zgXbqRIBzYYNPAkwBiEAW4fXc9rBDn/engcKBvr2j/tg8EqZRfl502 ZWEKogq+x3kpoXH1ZNaYkvSiMMvnh9CbJi+JqVuUkn0cdcFM+RSj1IC3NGr+NPpQSBGn qpxg== X-Gm-Message-State: AOAM531oLGbbdIdKHxofBRfeUv0AAR4SEL9hZvSLNZki0TEo2WbhDO94 /TwcrvConoIE9btkKJ5L1Fg= X-Google-Smtp-Source: ABdhPJyTQUnStKDmFdL5TtxVzyzh7/7v9BYbkRL6Rek436WPLC9J5HfEjEGGQM1+Hpp1d3yRyKWgYg== X-Received: by 2002:a17:90a:1a4c:: with SMTP id 12mr14739504pjl.89.1633724731017; Fri, 08 Oct 2021 13:25:31 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:a8e9:7950:57f8:970]) by smtp.gmail.com with ESMTPSA id x21sm170858pfa.186.2021.10.08.13.25.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 13:25:30 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Greg Kroah-Hartman , "James E.J. Bottomley" Subject: [PATCH v3 46/46] scsi: core: Remove two host template members that are no longer used Date: Fri, 8 Oct 2021 13:23:53 -0700 Message-Id: <20211008202353.1448570-47-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211008202353.1448570-1-bvanassche@acm.org> References: <20211008202353.1448570-1-bvanassche@acm.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org All SCSI drivers have been converted to use shost_groups and sdev_groups instead of shost_attrs or sdev_attrs. Hence remove shost_attrs and sdev_attrs. Cc: Greg Kroah-Hartman Signed-off-by: Bart Van Assche Reviewed-by: Benjamin Block --- drivers/scsi/hosts.c | 9 --------- drivers/scsi/scsi_priv.h | 2 -- drivers/scsi/scsi_sysfs.c | 28 ---------------------------- include/scsi/scsi_device.h | 1 - include/scsi/scsi_host.h | 11 ----------- 5 files changed, 51 deletions(-) diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 3443f009a9e8..b3b7b55a90c6 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c @@ -482,15 +482,6 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) dev_set_name(&shost->shost_dev, "host%d", shost->host_no); shost->shost_dev.groups = shost->shost_dev_attr_groups; shost->shost_dev_attr_groups[j++] = &scsi_shost_attr_group; - if (sht->shost_attrs) { - shost->lld_attr_group = (struct attribute_group){ - .attrs = scsi_convert_dev_attrs(&shost->shost_gendev, - sht->shost_attrs) - }; - if (shost->lld_attr_group.attrs) - shost->shost_dev_attr_groups[j++] = - &shost->lld_attr_group; - } if (sht->shost_groups) { for (i = 0; sht->shost_groups[i] && j < ARRAY_SIZE(shost->shost_dev_attr_groups); diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h index a5a2f18cc734..b7a82c426058 100644 --- a/drivers/scsi/scsi_priv.h +++ b/drivers/scsi/scsi_priv.h @@ -137,8 +137,6 @@ extern int scsi_sysfs_add_sdev(struct scsi_device *); extern int scsi_sysfs_add_host(struct Scsi_Host *); extern int scsi_sysfs_register(void); extern void scsi_sysfs_unregister(void); -struct attribute **scsi_convert_dev_attrs(struct device *dev, - struct device_attribute **dev_attr); extern void scsi_sysfs_device_initialize(struct scsi_device *); extern int scsi_sysfs_target_initialize(struct scsi_device *); extern struct scsi_transport_template blank_transport_template; diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 05b4d69d53d4..2e69fad0dc51 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -1563,26 +1563,6 @@ int scsi_sysfs_add_host(struct Scsi_Host *shost) return 0; } -/* - * Convert an array of struct device_attribute pointers into an array of - * struct attribute pointers. - */ -struct attribute **scsi_convert_dev_attrs(struct device *dev, - struct device_attribute **dev_attr) -{ - struct attribute **attrs; - int i; - - for (i = 0; dev_attr[i]; i++) - ; - attrs = devm_kzalloc(dev, (i + 1) * sizeof(*attrs), GFP_KERNEL); - if (!attrs) - return NULL; - for (i = 0; dev_attr[i]; i++) - attrs[i] = &dev_attr[i]->attr; - return attrs; -} - static struct device_type scsi_dev_type = { .name = "scsi_device", .release = scsi_device_dev_release, @@ -1603,14 +1583,6 @@ void scsi_sysfs_device_initialize(struct scsi_device *sdev) dev_set_name(&sdev->sdev_gendev, "%d:%d:%d:%llu", sdev->host->host_no, sdev->channel, sdev->id, sdev->lun); sdev->gendev_attr_groups[j++] = &scsi_sdev_attr_group; - if (hostt->sdev_attrs) { - sdev->lld_attr_group = (struct attribute_group){ - .attrs = scsi_convert_dev_attrs(&sdev->sdev_gendev, - hostt->sdev_attrs) - }; - if (sdev->lld_attr_group.attrs) - sdev->gendev_attr_groups[j++] = &sdev->lld_attr_group; - } if (hostt->sdev_groups) { for (i = 0; hostt->sdev_groups[i] && j < ARRAY_SIZE(sdev->gendev_attr_groups); diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 01732aabd7c3..b1e9b3bd3a60 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -225,7 +225,6 @@ struct scsi_device { struct device sdev_gendev, sdev_dev; - struct attribute_group lld_attr_group; /* * The array size 6 provides space for one attribute group for the * SCSI core, four attribute groups defined by SCSI LLDs and one diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index ab8775811e6f..c2b4d6677a76 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -473,16 +473,6 @@ struct scsi_host_template { */ #define SCSI_DEFAULT_HOST_BLOCKED 7 - /* - * Pointer to the sysfs class properties for this host, NULL terminated. - */ - struct device_attribute **shost_attrs; - - /* - * Pointer to the SCSI device properties for this host, NULL terminated. - */ - struct device_attribute **sdev_attrs; - /* * Pointer to the SCSI host sysfs attribute groups, NULL terminated. */ @@ -700,7 +690,6 @@ struct Scsi_Host { /* ldm bits */ struct device shost_gendev, shost_dev; - struct attribute_group lld_attr_group; /* * The array size 3 provides space for one attribute group defined by * the SCSI core, one attribute group defined by the SCSI LLD and one