From patchwork Tue Oct 12 23:35: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: 12553971 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 ECEB5C433F5 for ; Tue, 12 Oct 2021 23:36:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D694F60F3A for ; Tue, 12 Oct 2021 23:36:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235640AbhJLXiN (ORCPT ); Tue, 12 Oct 2021 19:38:13 -0400 Received: from mail-pl1-f177.google.com ([209.85.214.177]:46747 "EHLO mail-pl1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234129AbhJLXiK (ORCPT ); Tue, 12 Oct 2021 19:38:10 -0400 Received: by mail-pl1-f177.google.com with SMTP id 21so547738plo.13 for ; Tue, 12 Oct 2021 16:36:08 -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=WFxiHAJcId6btOZPFXQBocmsMr5XayYG7xecewfJNKs=; b=WSuXp0Ry1G+e6oGrz/GdEw/g3NHK/vVGLZOKIPynGzRMYWOzzjTSg7kFuL+UppfW8v DPdnyQCBr5wZV47RFyyEeP0O+SWl7CMGiC+gjxkBVLwKvtzHsBq6BCw9F74xn7SaHvUu HzntfQgkUWVVxNmB6G/AkmDnjbSisRhkB3NE+uqlG3JAqfYBBbTTUdPiWTCOsOO7/uaS /an6w8efXZRiFyfeAQ5YbgnWRGBt1STpQYEZzoMKkzc23g7jErnijvDaXAPMN41P0NOw 7dtmRI/5Qm2HCJ1fYVhNbJGTmMealTasbaOvOCqywiAhH+bBBZ7Ekr8oH+1I+YNpT2Yz l/jA== X-Gm-Message-State: AOAM532rDmbHZudVLXO1syMwJYE7nBCtGWXWRXoZb3AMGHaGrDIAoDK0 C8+/Exk36g3Bq7kmkdWbM4+ATlWte/o= X-Google-Smtp-Source: ABdhPJz2KO0PB7RcDaMyN5rc65zHJdmhKHMZ/k9kYqqKGVAlktS3/PfhxqgvZm77zwKMzJMLMM11Aw== X-Received: by 2002:a17:90a:39c5:: with SMTP id k5mr9552775pjf.211.1634081768064; Tue, 12 Oct 2021 16:36:08 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:07 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Greg Kroah-Hartman , Benjamin Block , "James E.J. Bottomley" Subject: [PATCH v4 01/46] scsi: core: Register sysfs attributes earlier Date: Tue, 12 Oct 2021 16:35:13 -0700 Message-Id: <20211012233558.4066756-2-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Reviewed-by: Benjamin Block Signed-off-by: Bart Van Assche --- 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 Tue Oct 12 23:35: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: 12553973 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 B851AC433EF for ; Tue, 12 Oct 2021 23:36:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9939260F92 for ; Tue, 12 Oct 2021 23:36:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235907AbhJLXiO (ORCPT ); Tue, 12 Oct 2021 19:38:14 -0400 Received: from mail-pl1-f180.google.com ([209.85.214.180]:35814 "EHLO mail-pl1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234169AbhJLXiM (ORCPT ); Tue, 12 Oct 2021 19:38:12 -0400 Received: by mail-pl1-f180.google.com with SMTP id w14so583344pll.2 for ; Tue, 12 Oct 2021 16:36: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=tzJeaPjhBUIp4h7voRFmG9gOes9l1e0X/x40kYKgIsQ=; b=mV7r5SYmZYm2zY1IpM+HK35NfYLNrArrTFwhNnXyBysEdhiDjUI94Met/oh3V4emJJ Omi5j1LWZIKoBp4v8kfGZyREdspgKalt/4xtUoGPY2NIyhHHSd5QimIBvsBvUWvuD5xw ZTKx+rzwk2SIsQsEQ2unXEuWgmXUBuK/nB302sPSOcvV9eg51rMz34joQOiUMmeFjjWR lwUM5n4ex6yp0I201JwCut4/71/MnSVmc2OS67DYK2DJxnKIVB0RsoIaZjx0icQXCr+N mCSLR6CTe8YBhFknlSEkl1CvPlw/LkPLcZ44XLu2fvcMtM9XvNWhVAr6vydbVy2EBIMP JrOA== X-Gm-Message-State: AOAM532QknMAh9uirbI4bpZkl7OhgtYWdwcvNe6y20Jp+j8ouI3OeHhG gJ2CORt7XtINijxk57Z2OAZPcdJF3sM= X-Google-Smtp-Source: ABdhPJxN4XuTarrzW75VjBo7gSEtCrr2ki6nYf2ePLkdljLtPkcmRtvCgqFxAtFeZRjSMQZHvyUTig== X-Received: by 2002:a17:902:e883:b0:13f:1393:d185 with SMTP id w3-20020a170902e88300b0013f1393d185mr27800732plg.64.1634081769826; Tue, 12 Oct 2021 16:36:09 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:09 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Damien Le Moal Subject: [PATCH v4 02/46] ata: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:14 -0700 Message-Id: <20211012233558.4066756-3-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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. Acked-by: Damien Le Moal Signed-off-by: Bart Van Assche --- 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 Tue Oct 12 23:35: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: 12553975 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 69B37C4332F for ; Tue, 12 Oct 2021 23:36:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4A44860EBB for ; Tue, 12 Oct 2021 23:36:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235925AbhJLXiO (ORCPT ); Tue, 12 Oct 2021 19:38:14 -0400 Received: from mail-pl1-f182.google.com ([209.85.214.182]:33461 "EHLO mail-pl1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235840AbhJLXiN (ORCPT ); Tue, 12 Oct 2021 19:38:13 -0400 Received: by mail-pl1-f182.google.com with SMTP id y4so609870plb.0 for ; Tue, 12 Oct 2021 16:36:11 -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=GxD5SZTbT5cm1Kw/TB2TyO5XX8Hwni+Jn19OglsIPGlI7+Ht6hSF6rL0ZlPLMHL+CB kfYBJaG18YSOmIUfIkZ+l03NOyJPpN3qO7YlBFBOa3tgv7dlzD74kbK6A/MYwCDmmBCc 1hBkpZSN/L0TPYZER9bDUYXhnlk48duw8WeTA8U5tmTHpNH6lgGZBh+fogiHhbxReitg 8eMd6tVaR0Ca/JeSFFFmYIvspOa2A0HP6sFwZjhVO2BVjWZChg2rhfjLtZyfz3ZiWeZP RmsBMFASvH2fCK8I9ZO2zC5Fuq4IRBhvdC1w2lYOWTEp7WfhdJkFenEnO/lXyZbxFTU6 wLPw== X-Gm-Message-State: AOAM530ONkUzEeNy1h+uZ8s2L/TrKVA0ovvqfZwDCvJD/j8RSAgL+FxO UCI9YS4LZ7e8SYBDSfD6Y5Q= X-Google-Smtp-Source: ABdhPJxMs9SWoVt16ygBy+ysz4ukgn+ArJN3aL4VWcFA0VUA5IC3MyQooN+EOwme2GMepcd1rez5YA== X-Received: by 2002:a17:90b:4d8e:: with SMTP id oj14mr742963pjb.237.1634081771123; Tue, 12 Oct 2021 16:36:11 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:10 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Stefan Richter Subject: [PATCH v4 03/46] firewire: sbp2: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:15 -0700 Message-Id: <20211012233558.4066756-4-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12553977 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 858DDC433EF for ; Tue, 12 Oct 2021 23:36:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 647D660F92 for ; Tue, 12 Oct 2021 23:36:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235952AbhJLXiR (ORCPT ); Tue, 12 Oct 2021 19:38:17 -0400 Received: from mail-pl1-f176.google.com ([209.85.214.176]:34711 "EHLO mail-pl1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235950AbhJLXiP (ORCPT ); Tue, 12 Oct 2021 19:38:15 -0400 Received: by mail-pl1-f176.google.com with SMTP id g5so587613plg.1 for ; Tue, 12 Oct 2021 16:36: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=/VigYoDqQaVLh8ZnJ8MkI1sXa+kkie0GLhmAN4WYaIg=; b=H++P9uK28jkh/NtVPGFq3nScpnBbNabjdCIWmqsFvrl/olW40J6pMI56juSLVCDwLK AZT9Wl8R1460ZrU3C6jJG0ZTT7wfMD+uXeMihJO4AOE4NYDyBANXxJawdomd39LWlGdK nxeskxIMIWwhL03D6beE8DLHwzgUdqqW+Erc2ZjjvSmkl7Fel6bFOuIZgwtmiUH/F8uJ sV6dBNQCzvDpwwhEfhuNQCA/26quraiCXDZRhIntoAdNRiq85qmM+NbEt1A2B8T3jzt/ Q0jaCeCg7aiJ8TT6MOI/AdH6ZK+ZaujB2TbAWGlpPq+G+afZ7LlSlclwEjO5bdW2yyPv kIFw== X-Gm-Message-State: AOAM530aHvWHCh1Hx6wIA1CKsY5G20pNIaEfxSVPJHQUCNV+a/+O7g5V jDGy/2bMImyK1cyuukatB5Q= X-Google-Smtp-Source: ABdhPJwhFBoW1p9MTzsR9Ug5ufQneoR0OKJCABx/IK3V94T/Rw36wBg4cLYSUR8oSqr1fxCv+k08kg== X-Received: by 2002:a17:902:c401:b0:13e:f5f2:f852 with SMTP id k1-20020a170902c40100b0013ef5f2f852mr32522401plk.29.1634081772492; Tue, 12 Oct 2021 16:36:12 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:12 -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 v4 04/46] RDMA/srp: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:16 -0700 Message-Id: <20211012233558.4066756-5-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12553979 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 1BB5BC433F5 for ; Tue, 12 Oct 2021 23:36:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 070E660F3A for ; Tue, 12 Oct 2021 23:36:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235950AbhJLXiV (ORCPT ); Tue, 12 Oct 2021 19:38:21 -0400 Received: from mail-pl1-f174.google.com ([209.85.214.174]:46749 "EHLO mail-pl1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233870AbhJLXiQ (ORCPT ); Tue, 12 Oct 2021 19:38:16 -0400 Received: by mail-pl1-f174.google.com with SMTP id 21so547842plo.13 for ; Tue, 12 Oct 2021 16:36: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=gA6NRNH2A9Xt41KnXTAILbLbUYLHxLunMHE6eX3ZNbw=; b=IKmneDxJF6ecs0J4KvrV8lPexsqHM80RBgiMYve6uDu1akxx10eSdl/1vjFnUU5jCC 0H0H3WLBS/j4f9P+lGxCu7nzPIkhRm/Hmjnhu2SEU2te1qyxNHqWQVVo8sLYhGC/zExb an3WEU9GXYbqIim+iG37fZIxP45cWArsNcaXxv3MgVgAYw35iBf8uQ0N7FRZxDmp9ahf 2q+wfoYpaXwUd7rUdok+SOZIGG7U5ioX7ZCINxwy1vuCQt4Jy+o/g4XyHGzcXQPJeBvi 1AOPiOr714Pw2Q5qA1hWUJBCzo2b7A3BukNKJY7xFYcvDdjIAitXvO85mNJQVGpvkpDp Lc+Q== X-Gm-Message-State: AOAM532JGP2H+NA3HA3ZFRtQq982Ch+/8ZJPmmW8ozN4PTfeRzFRHbZc 15TaC54abBkG7IqVjcQZ7s8= X-Google-Smtp-Source: ABdhPJwfhsthil74rfMwZs4Xiyg/NiJxihh5X5X+0n2TyBCUSTqRsVPYQDtPOsMWJ137ZZOxb/bysA== X-Received: by 2002:a17:90a:7d0f:: with SMTP id g15mr9398001pjl.227.1634081774057; Tue, 12 Oct 2021 16:36:14 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:13 -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 v4 05/46] scsi: message: fusion: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:17 -0700 Message-Id: <20211012233558.4066756-6-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12553981 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 77AF4C433EF for ; Tue, 12 Oct 2021 23:36:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5D28360F3A for ; Tue, 12 Oct 2021 23:36:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235991AbhJLXiV (ORCPT ); Tue, 12 Oct 2021 19:38:21 -0400 Received: from mail-pj1-f50.google.com ([209.85.216.50]:51977 "EHLO mail-pj1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235972AbhJLXiS (ORCPT ); Tue, 12 Oct 2021 19:38:18 -0400 Received: by mail-pj1-f50.google.com with SMTP id kk10so818651pjb.1 for ; Tue, 12 Oct 2021 16:36: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=Mp9ekGfBG0AnXhgZJmGluTHS+rWkMf+n4jEyCQoMsS0=; b=iYKmn72zL1eq6SutfF20vZSgeCvHHRwqILE771h4JUvh5z6/oEMQpkwqHe0ybo6z0Y Pv+oZwgSSrZdzjV1bHMdGTr363+qRORnSqBndNLeosxJ+S4HA9V+Zlg3UjEDVNTUq1kh /WlDSJGu4kfuR+fHTnydytpNN7oF1rpSGFsn5qyfGi622qNj09KgLw0yIqxsaWvWWDQO kcnigkCYVV2ZVKZP14VrT5H2TxNmbu+Bm7pF6d3NhDocN48bL8NZTKNJom6b/3mP+6h0 lU5OWbBUCHfLVFRE5p9681l5DVS1SaCBAJRd2RV300WJQrVROxoeaGG+sXSm2Y5YOC/q ZoAA== X-Gm-Message-State: AOAM531H1G46BIe2ANo54JcG/igpjTv3KnElI34Pt8xfQO2gMSCb+yvx 4cBX7Q0I4nYF+6ahxIsWSyI= X-Google-Smtp-Source: ABdhPJzCCzx915IyHheIdBsvdE/b7y5E67UPzcBJ2DgtvHup+QVElhqgF8JSBBDleJfrymvJbIbzGg== X-Received: by 2002:a17:90a:6d27:: with SMTP id z36mr9197743pjj.231.1634081775626; Tue, 12 Oct 2021 16:36:15 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:15 -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 v4 06/46] scsi: zfcp: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:18 -0700 Message-Id: <20211012233558.4066756-7-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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: Benjamin Block --- 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..c302cbb18a55 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_sysfs_sdev_attr_groups[]; +extern const struct attribute_group *zfcp_sysfs_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..709fea7c1380 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_sysfs_shost_attr_groups, + .sdev_groups = zfcp_sysfs_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..dbf3e50444e6 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_sysfs_sdev_attr_group = { + .attrs = zfcp_sdev_attrs +}; + +const struct attribute_group *zfcp_sysfs_sdev_attr_groups[] = { + &zfcp_sysfs_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_sysfs_shost_attr_group = { + .attrs = zfcp_sysfs_shost_attrs +}; + +const struct attribute_group *zfcp_sysfs_shost_attr_groups[] = { + &zfcp_sysfs_shost_attr_group, NULL }; From patchwork Tue Oct 12 23:35: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: 12553983 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 E2F8CC433FE for ; Tue, 12 Oct 2021 23:36:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CBF6160ED4 for ; Tue, 12 Oct 2021 23:36:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236009AbhJLXiW (ORCPT ); Tue, 12 Oct 2021 19:38:22 -0400 Received: from mail-pg1-f173.google.com ([209.85.215.173]:43687 "EHLO mail-pg1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235999AbhJLXiT (ORCPT ); Tue, 12 Oct 2021 19:38:19 -0400 Received: by mail-pg1-f173.google.com with SMTP id r2so532240pgl.10 for ; Tue, 12 Oct 2021 16:36: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=dTNedSEFjqtd+pJzmAKavcMIBaVjV9fuMU4exKPIasc=; b=hDGg9LMGE4TRBUBVkzCKijW5ytAgFV4cLMM1oTdruqyr6R480FuttXrA0DINsgnFN3 6AAJyEb5TkLAom3FpyCgdsxVVGhl+Z4+/2dngloq7A5dOP8QkqKZdxexN2BkQUA4Ig3b TLGwpA5BysCcL6WpnGkPh9BzG/nXdKzufStNsOcJqHB+dtnQwrmoxKgysFONyazQPffW NS4a2pbAkDRAZnrJDaU27E4OB8ihYCjt0e1qt1HYhgzthDIfT87henwSaGF6wb0TeEbi RiNbSMgWvPa77wOkTsTWGxDP5597OVTPWDCr8rc041h6LYBbV86gtB1+6284iwoMjwzY xlfw== X-Gm-Message-State: AOAM530xGApTlIq6dvQK5ACSRnfVudWVQ7oWo1irwzEuk3nmclQbMCN3 aMPvQ69dO9IzCGN9W9d+UVA= X-Google-Smtp-Source: ABdhPJxk6tgC+Bokf1Hz/mZDm51s9sbvwoMkaWh6q9P4oCJZSyLub9QlUUDgUk+chuB6k/++Js3Raw== X-Received: by 2002:a62:7b87:0:b0:44d:3e28:a2ac with SMTP id w129-20020a627b87000000b0044d3e28a2acmr5406430pfc.67.1634081776940; Tue, 12 Oct 2021 16:36:16 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:16 -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 v4 07/46] scsi: 3w-9xxx: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:19 -0700 Message-Id: <20211012233558.4066756-8-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12553985 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 A66F6C433EF for ; Tue, 12 Oct 2021 23:36:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8FF3A60F92 for ; Tue, 12 Oct 2021 23:36:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235981AbhJLXiX (ORCPT ); Tue, 12 Oct 2021 19:38:23 -0400 Received: from mail-pf1-f176.google.com ([209.85.210.176]:43572 "EHLO mail-pf1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235949AbhJLXiU (ORCPT ); Tue, 12 Oct 2021 19:38:20 -0400 Received: by mail-pf1-f176.google.com with SMTP id 187so820151pfc.10 for ; Tue, 12 Oct 2021 16:36:18 -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=C4BEvB8CBQJuuuFEuj/pNvmtRuzFFXKa72tg5Rzf+qEobhYi5fHTDhlgQdO6l7qcXK iE55gppju3wLljEvfYseKb/g10UGUvDeDW8NyEICp9S/rknp0+vWvnK24/n3N23tr2zx nq+fWJxF8rK1r6KyA41IVA0mlPWSIJr/kJhoa98D2K5BUiOqlHusj6R+FfBpt6KNjNBF Q82gizKFYsB0DcPCmHRAQni+QkbzM6hn/m0H4FgfG5XEStO61v9IpIt4zaQPQgwpFldQ rRiI4UvT56iavgmQ77jz7Kz2bmsflr7qoe5JLbhzp8Ks6obtzYV2CqL5t6HzBckAxO6O fwBw== X-Gm-Message-State: AOAM532iL9Lf8pd5xIK66agdzsR+x5nPq+bqAXSF90mQmBo9pptlLeip HojKzwi8+Y7yy5U9h0+9IE8= X-Google-Smtp-Source: ABdhPJyashgFet2mWozvcJthjinlzpoDZGunb0eZvfx/QZQKVJsVDqxZygF9CJfAUEj6V/eLi0jjfQ== X-Received: by 2002:a63:101c:: with SMTP id f28mr24880605pgl.330.1634081778427; Tue, 12 Oct 2021 16:36:18 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:17 -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 v4 08/46] scsi: 3w-sas: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:20 -0700 Message-Id: <20211012233558.4066756-9-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12553987 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 EC308C433F5 for ; Tue, 12 Oct 2021 23:36:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D352960FDA for ; Tue, 12 Oct 2021 23:36:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235925AbhJLXi0 (ORCPT ); Tue, 12 Oct 2021 19:38:26 -0400 Received: from mail-pf1-f169.google.com ([209.85.210.169]:35582 "EHLO mail-pf1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235972AbhJLXiW (ORCPT ); Tue, 12 Oct 2021 19:38:22 -0400 Received: by mail-pf1-f169.google.com with SMTP id c29so859266pfp.2 for ; Tue, 12 Oct 2021 16:36:20 -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=lysHqHNgxSBRoMIQIYsqW9SyeLyO+AsfVCEr9xSJRY22jgJu1VZhCt/IRTRuSUqaoN WczsWk53XkWEbMgt2wuDjcX1xwWtKq8RmSW6ZczWaVJ6xoAWq05LQ9MTzu2YrQ7IzPE7 LGXNeHpD6+GOWGTs4oW9qE25M2GDqjWB8o3Q8zWn7XH3ehzzDFRxsV3qJcwy2s4FAUZp 3refMgwidmb/rPIqB2ZuivaGwHr31u8OBUutNIPYxqe7WY0e5k5V0nxJNQhQZnPrIvbK 4BMT6ysmwJtb1woEaZ4ACEvTxDmGs/hAGfl79Umq0ckQQXvJxicbTteTY3oo60yCh2hb Pfyg== X-Gm-Message-State: AOAM533sgpw/KLMm5e3doL4PQ3mskkv1WsU/53AG1JROjO6RT+NOomCU vC7aVPKYwDeSByncY9LTqLQ= X-Google-Smtp-Source: ABdhPJwuWi7UwiV6UhpDqNdFtijBm/WH0vn46XSND/JVgY5IlEGUekFlTG6ek4JkJpdzpEB1QbXylw== X-Received: by 2002:a62:5257:0:b0:44c:ed84:350a with SMTP id g84-20020a625257000000b0044ced84350amr23301979pfb.79.1634081779700; Tue, 12 Oct 2021 16:36:19 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:19 -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 v4 09/46] scsi: 3w-xxxx: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:21 -0700 Message-Id: <20211012233558.4066756-10-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12553989 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 DC3CAC4332F for ; Tue, 12 Oct 2021 23:36:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C870060ED4 for ; Tue, 12 Oct 2021 23:36:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236036AbhJLXi1 (ORCPT ); Tue, 12 Oct 2021 19:38:27 -0400 Received: from mail-pl1-f175.google.com ([209.85.214.175]:40689 "EHLO mail-pl1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235907AbhJLXiX (ORCPT ); Tue, 12 Oct 2021 19:38:23 -0400 Received: by mail-pl1-f175.google.com with SMTP id v20so568016plo.7 for ; Tue, 12 Oct 2021 16:36: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=bke2QLpps6GpzDcXZNnBKyGGpzVgxKxfRpS6Pp+DtoM=; b=X9UutX1g8+wRrM8B2MWcTteJ1PF8gB7u3s3z+wk0isGYLaYdBZPIpM/ktOu9qhA0m5 o42ocCRR+Pnf7VN3/GMNa5Q6WTIZZyQKn+inoQE8WaSpKsIr+0WSfrO/HscdAlKF4o/d r8jaLQOPK+3gyjkbLRlVDsAPG4HioGkYniowsEpdUmzfpEHuKF0CjNsCH/+rmpd2H4fL HhkemNg1ro42a8tokWJ4GrOqNQN3JF8jznWFWsEPvMm4Fjj5QJB3+bmOxIMUX1H7P3gL xhGegQm5BoOJY+rZANPRWOuiOgbKgy2gM4sitVPFu/n6bCPJ7FU7GS3Yl8ymZli1VNFW sBPg== X-Gm-Message-State: AOAM531SrCokhhuFBEX73Y5Gc3t4Q5FrW1TN+I1Zzb5ghiHaeTGPQun8 oIBpATK6dhBkSRDlSY8OnU5ZcPb84xo= X-Google-Smtp-Source: ABdhPJzdqroWBqW31LUGQLrXEa3DE/JUPt9zQYV8089iLhIFyYopSYJ6+KxY/hqW1LErYdCsc98Vqg== X-Received: by 2002:a17:90b:3ec3:: with SMTP id rm3mr9442503pjb.186.1634081781010; Tue, 12 Oct 2021 16:36:21 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:20 -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 v4 10/46] scsi: 53c700: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:22 -0700 Message-Id: <20211012233558.4066756-11-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12553991 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 5EEDDC433FE for ; Tue, 12 Oct 2021 23:36:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4666D60EBB for ; Tue, 12 Oct 2021 23:36:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236011AbhJLXi1 (ORCPT ); Tue, 12 Oct 2021 19:38:27 -0400 Received: from mail-pg1-f182.google.com ([209.85.215.182]:37844 "EHLO mail-pg1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236017AbhJLXiY (ORCPT ); Tue, 12 Oct 2021 19:38:24 -0400 Received: by mail-pg1-f182.google.com with SMTP id r201so558003pgr.4 for ; Tue, 12 Oct 2021 16:36: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=q3dt644jJFcxByiVopzbHO/3VhgDBHnjcH7YBR0cYF4=; b=vR6Oz99k2v4VAmCGOo6viem606SilVs35gvamdXyUXAvC6Yx8NRn32sFvlbgnPb9i4 GcCDxF/7FgHyom9tv8uCrQqAFtyu11Eqz9Yo/olpeUywV/ITqvswmkBmdlDyc7aXtcZW m5uVLDL4X8KyELRNIu+HPbqx/E3cS8LL6U7xqcxuk03RKAJOyY5VkwHIdxcu+2q46wo7 XHfCZ3lcRTPcr6Hv+gFR/18LSOXLpeS4QGuDnijiMfS2tPSzu/8PBEJGucBYnyivGadM GZ3sdMZm+y6HH1qi6bnrMfvR8pTqInevrUpgbF9tzaG2uzH9vrm54vJuCDBxXLJ/Ue1m e7Gg== X-Gm-Message-State: AOAM533eYv7blr7DUvLM36nQt7HtbsYidTVygbxxScYwNSA07RUElqZU +R0eBaCpvm8wljtiz01vP+Y= X-Google-Smtp-Source: ABdhPJz9gYE8yAjz27TsMmjQ9iM66mliZLKAkhI+m1tEzqkY1kWb8vGISFoyDZRyqnrpbskHrTaS5w== X-Received: by 2002:a63:470b:: with SMTP id u11mr24836487pga.441.1634081782332; Tue, 12 Oct 2021 16:36:22 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:21 -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 v4 11/46] scsi: aacraid: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:23 -0700 Message-Id: <20211012233558.4066756-12-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12553993 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 2950DC433EF for ; Tue, 12 Oct 2021 23:36:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 116E860F3A for ; Tue, 12 Oct 2021 23:36:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235952AbhJLXif (ORCPT ); Tue, 12 Oct 2021 19:38:35 -0400 Received: from mail-pf1-f181.google.com ([209.85.210.181]:41841 "EHLO mail-pf1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235922AbhJLXif (ORCPT ); Tue, 12 Oct 2021 19:38:35 -0400 Received: by mail-pf1-f181.google.com with SMTP id y7so832639pfg.8 for ; Tue, 12 Oct 2021 16:36:33 -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=n7PZLVkfsWbjwEO4TuXRqxrVWhhqV9JfXqGWSqkCURLNrrpsFaMkTJKlA/Exfmpzb0 95PtQf8uPMEl5CfnLgI7w9q9imhovwzQWSVcvXO7zyB07tf1RjNftoxAlQKaBPy7W44a Y+jtNSc6pSb6emHpBO5exnkoCGSaF5KjwYpOnx0EHlMw/VSJ7P05bIvl13D9oOYYTBv6 22o99BATjsG7d4R2Ar9SSxjiw03ZzJ2oD1WT9CR7NalmA/RfE61IMWeYE8HVLM9Csm6u SJ6fcm//HOsvmPFB6LVlVo3GF0fQ1c/x9H08V0M3RwVIwbMCm9p/HwCCNgraK8GEZOi+ EcWw== X-Gm-Message-State: AOAM531buEIqrmvC4JqDm9GDgPpbbpidtRBlB/+B5y7Bqnkt17raQPnu pcJ9KTjlqSv2wAMySzti4Lw= X-Google-Smtp-Source: ABdhPJzXy8a1ArfNhZQI3csf6tXkHmUSGP1NYG1qlRamIQQBOc0FEJumOVTRbVuOec3j7sGezimmsg== X-Received: by 2002:a63:4717:: with SMTP id u23mr25030183pga.359.1634081792715; Tue, 12 Oct 2021 16:36:32 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:32 -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 v4 12/46] scsi: arcmsr: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:24 -0700 Message-Id: <20211012233558.4066756-13-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12553995 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 CD9D9C433FE for ; Tue, 12 Oct 2021 23:36:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B7F5C60F3A for ; Tue, 12 Oct 2021 23:36:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236017AbhJLXij (ORCPT ); Tue, 12 Oct 2021 19:38:39 -0400 Received: from mail-pg1-f181.google.com ([209.85.215.181]:43715 "EHLO mail-pg1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235991AbhJLXig (ORCPT ); Tue, 12 Oct 2021 19:38:36 -0400 Received: by mail-pg1-f181.google.com with SMTP id r2so532744pgl.10 for ; Tue, 12 Oct 2021 16:36: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=0oytqwBYbr35Z6MtPz7HCBDp8jm+jqZ/k5dsTUcnRlA=; b=O3GvtAJUJb0fzhmxZVY3AKbl0YR3VfbrxWu6US3+kClZgTwr+mxHDKMadCqyBbIChf csCqR2pDRTj/oANVHSOGbNea3DvaynNsADb+RbFFHjLtKskpZ7dNnPb73tD+RVj2r3ux 0p3XbSTFCLnAZsveo9me2QzS/6c1PQPlqNppb2JZvT/HGhoKhaP/Y7JsbhaOdcdNO/tb RCQrLckLubMS1H5zvfyq1iWrj8nTpuK1VKbzvK1bRFEXco3YSinQIN/2cHQoV5MJgbuN HduAkgKhV9jUhY/wq7PRTenCyD6luMHOhE7kmSks4igJg7uz6XNtHG8g0Rz8tjZCIn8d XVYg== X-Gm-Message-State: AOAM530oLMbuMVuIjpi/K473ahrHTbTvDz+mgj1Pd6Efw2Y6/W83d9jj N++oQJGpOVJyQG4bEbqlTg8= X-Google-Smtp-Source: ABdhPJyu9FvO0PrKAzab5zgVOTwmUkyIe+US027x8BE9L/rTcWrS/GPq6Jm9dkBZl1bxdx7XBi6YYw== X-Received: by 2002:a63:3756:: with SMTP id g22mr11587415pgn.279.1634081794033; Tue, 12 Oct 2021 16:36:34 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:33 -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 v4 13/46] scsi: be2iscsi: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:25 -0700 Message-Id: <20211012233558.4066756-14-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12553999 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 9C59EC4332F for ; Tue, 12 Oct 2021 23:36:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 86D7060ED4 for ; Tue, 12 Oct 2021 23:36:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236098AbhJLXij (ORCPT ); Tue, 12 Oct 2021 19:38:39 -0400 Received: from mail-pg1-f172.google.com ([209.85.215.172]:38644 "EHLO mail-pg1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236010AbhJLXii (ORCPT ); Tue, 12 Oct 2021 19:38:38 -0400 Received: by mail-pg1-f172.google.com with SMTP id s75so554154pgs.5 for ; Tue, 12 Oct 2021 16:36: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=h978B1xPZVs8EBEqkQJzccy7GM6g4uoYqAZnY/bH15M=; b=Vos9iSGlaqeVoEYqTEA8/g9Lg5BuqpSSvib7GTz8wkBaUj58NzrAOywA9sci8U5eUa zsQk1aWXubNu9Qo5pSqB8A9ZU9pA/JHp1aTx4Q2MOicTwoN+sTSjJOBbfwcSGog1aYx7 EtjUf9V4nPrPPeZYgxQKdIk52smUBOBLKgqYWD5u2u4CMS8SG00zkszcvjEoZhX37WIw d0VF8JpDs6ONoYT+UMWip1bO+mPrmCbiB31bXThHtL1wipBRPTLBb81YFwpwhK4CbsLt p7unSHwHyxJZpWpJEFBDSe6yKg0T9bdhyiwfSjjBBl71ryD5pmZEM/ijw4N2NxaPr42Z 8PNg== X-Gm-Message-State: AOAM533CsWDxqJ4qbnSEILr20uNPdWmTKDstXxPni1SrwOwyTHW/+rzL T7CMxZql2WL5jN4GFjAbnIY= X-Google-Smtp-Source: ABdhPJwPpCY5JLESqxDh3fXnPNKWb3V93CNlDFveicajcGFdVv2kUiyIHTATfOQJRqryc+luB5sQmA== X-Received: by 2002:a62:5297:0:b0:3f4:263a:b078 with SMTP id g145-20020a625297000000b003f4263ab078mr34429863pfb.20.1634081795495; Tue, 12 Oct 2021 16:36:35 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:35 -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 v4 14/46] scsi: bfa: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:26 -0700 Message-Id: <20211012233558.4066756-15-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12553997 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 F0743C43219 for ; Tue, 12 Oct 2021 23:36:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DAEAC60F3A for ; Tue, 12 Oct 2021 23:36:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236106AbhJLXik (ORCPT ); Tue, 12 Oct 2021 19:38:40 -0400 Received: from mail-pj1-f41.google.com ([209.85.216.41]:38825 "EHLO mail-pj1-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236023AbhJLXij (ORCPT ); Tue, 12 Oct 2021 19:38:39 -0400 Received: by mail-pj1-f41.google.com with SMTP id g13-20020a17090a3c8d00b00196286963b9so3037892pjc.3 for ; Tue, 12 Oct 2021 16:36:37 -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=2Fb146xHdtpJQYv/PsZoUkOE5dNwmkGgbNC2acyEqxosrQP5DmQTFltgSxRYqbAxa/ QjiQHVGKKZ0eQrDMOIzFKmrRBDXSfVC2gVsAet55hYYWjbrD4ixi6hDdn7eCr6UfGIqX sh1nlfP9hHFG7ZgppKBqe9/SXIVSsaic8VgjvdXsHynbFesU0wd7ZR8kO1KezsAOQCZ/ u3+ZC0RXJkF0GOPwPn7yyLb5b0isYRxwMCbmsGzLhBGPMvBGHy1pj9rYA3LajeotNl8G QBLYSyEvtMURRBkvD4zvMdmSo6W6KA9FBAZ94SJJEUd6s9GFrHbZYYaZ1ILbB1+lBnLv 8HYw== X-Gm-Message-State: AOAM533HDjglFWRNva8NoKG799p2ewzjAsqm6+3G9P95HGitUSiGr1as 0C6Igqo8smo0t+Jhnbadl9E= X-Google-Smtp-Source: ABdhPJzNLYfjrnh22eyYyJY6/qm1PdijzR0AtBZwIqSOxl/cPX/FO4aOLVp96+4dsC0nTIiD2aHkGw== X-Received: by 2002:a17:90a:680c:: with SMTP id p12mr9264261pjj.33.1634081796913; Tue, 12 Oct 2021 16:36:36 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:36 -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 v4 15/46] scsi: bnx2fc: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:27 -0700 Message-Id: <20211012233558.4066756-16-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12554001 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 F37D9C433EF for ; Tue, 12 Oct 2021 23:36:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D63CE60ED4 for ; Tue, 12 Oct 2021 23:36:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236010AbhJLXim (ORCPT ); Tue, 12 Oct 2021 19:38:42 -0400 Received: from mail-pj1-f45.google.com ([209.85.216.45]:44639 "EHLO mail-pj1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236114AbhJLXil (ORCPT ); Tue, 12 Oct 2021 19:38:41 -0400 Received: by mail-pj1-f45.google.com with SMTP id oa12-20020a17090b1bcc00b0019f715462a8so838585pjb.3 for ; Tue, 12 Oct 2021 16:36:38 -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=A/Z7YPbetwke0zTbYAv8+B6LrCMxPVBuwIGV2vpDtdxJztx3Ro8vvyFxg0vMCB9bhP Gdnxf/MjuZjKMQF7DzjiDxx00rmjqX9DT3L1CyS9hZI87bJgmf63SZiLZInPOMdoTgg4 Ezwv3vDWo6kY/kPPw6SAv92HvevP+AGexQDmrbahRZlTVXq/C1g3bqVSk8z+cXh25UsV B6HfbwiCAHOnel/NBnU2SPOiFpdmDCA3gjvGjf3D5JXZWDl/Kc3PF5D+k1ZntRCXQPWH un1Jjs/1oNXlxZk9nWQFOhNrTnV5PWDjhd4pvAA2zmJ6TOvkrtkV2ZondzaoD6CSWd7C duXw== X-Gm-Message-State: AOAM5320H6jDbItm5+GkIDlBXjV4G3FJsyl+kVUInU0GHPYVnnjy6nnq vKU+LFu+WHJ8mnlAmo163BQ= X-Google-Smtp-Source: ABdhPJyNGEP2oQQKo35rMUMETe1wQML1BvylWijIRVVfJPYzdj9E3RrTXpjiEv8yIyuXuyo4hrpXsw== X-Received: by 2002:a17:90a:3e0c:: with SMTP id j12mr9502206pjc.23.1634081798460; Tue, 12 Oct 2021 16:36:38 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:37 -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 v4 16/46] scsi: bnx2i: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:28 -0700 Message-Id: <20211012233558.4066756-17-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12554003 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 F2DFDC433EF for ; Tue, 12 Oct 2021 23:36:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D836960F92 for ; Tue, 12 Oct 2021 23:36:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236054AbhJLXir (ORCPT ); Tue, 12 Oct 2021 19:38:47 -0400 Received: from mail-pg1-f176.google.com ([209.85.215.176]:38655 "EHLO mail-pg1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236124AbhJLXip (ORCPT ); Tue, 12 Oct 2021 19:38:45 -0400 Received: by mail-pg1-f176.google.com with SMTP id s75so554331pgs.5 for ; Tue, 12 Oct 2021 16:36: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=vM4jbQskNaFDXzTVQqQG1k37VqAHDN3vzlXEf6ehPR8=; b=gd8KJ7nePX2nDdJHzJ1wIFnC0qHwJCNLq7GZxe8MinqIva9yvgZjkX1Dy6QOaBMrYj Jij9kNmp3klcfJSTIimoOykHHglq3l8pG+Hg/wmgWdpYG/zo2WGR9TB1uziGrW4XqUDM OjI0oFbj9j5Cb3hMutvgtH6KzoqpH/R9ZyQ1r4JkhXiJdpPw7v8RHU0u9Y3Lxa1qhIC1 +fjUTxKLMfzUvcqeQk7w5XBhP6AEt1fwum5W/GYR7xAJgqIkqrt0vvL5GWZJjcNB9x9o Oeik63RJ30jBKoKBUcgORQ4fCI6kN4vP9V+qceeWQdpL0P9+E3rJ4ZsA1N7OR2Lg9/NH s9lQ== X-Gm-Message-State: AOAM533DoRn03HTk+F62KQmBhFw9aC8ksxQXl2Fd2gQAth8w/GB7b+5a PorXHo/E22x6ih5+uGOSGofGYpQLQRP/Dg== X-Google-Smtp-Source: ABdhPJxTrR3ce89vRa0IVjylrrILp5w+xdETvMNKBUMwAc1fRa8JqDt63XxgevD+4d8/qZDao8SECg== X-Received: by 2002:a65:47cd:: with SMTP id f13mr25112367pgs.439.1634081802714; Tue, 12 Oct 2021 16:36:42 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:42 -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 v4 17/46] scsi: csiostor: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:29 -0700 Message-Id: <20211012233558.4066756-18-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12554005 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 D7C78C433EF for ; Tue, 12 Oct 2021 23:36:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C305D60F92 for ; Tue, 12 Oct 2021 23:36:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236071AbhJLXiu (ORCPT ); Tue, 12 Oct 2021 19:38:50 -0400 Received: from mail-pj1-f45.google.com ([209.85.216.45]:36698 "EHLO mail-pj1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236140AbhJLXiq (ORCPT ); Tue, 12 Oct 2021 19:38:46 -0400 Received: by mail-pj1-f45.google.com with SMTP id qe4-20020a17090b4f8400b0019f663cfcd1so3053018pjb.1 for ; Tue, 12 Oct 2021 16:36: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=I0c+nV8p2rT/HmjUOeDz34YoCK9/gAs2RcO0O3Za1pc=; b=D14BSfOPLHeYLObBKhR5ND0FvkBV7Nxnoo1tk68aL5AKXV9UJ/YO/1YrIKK3uStNf4 EdQ/97CzfocXywfMkifTL+O3NVgUXsuN7nKXxzu5tPUbK9caylVlTHQf1UomVt7GP+je gDweDftrlV54EtyD9RiBkhCOqOALSJ6SP7LczD2JZ7jqK2oYN9KJHk3FxJB9h70BJxKF AP9Kb3VRWBrNdh9N7oh47v4e6WS6jGm0dNV6+/SsTdArbc2es85FwwD8aK3bJyLaUt0a LjauFH8/qBQe4FeVg78rdv4wnynUft/PkLIvBP6VP5US5yBu1fF4iO8wgRpoAsqHlzzB hBIg== X-Gm-Message-State: AOAM5306r6Ag7tn+bzS7QY1dXs+epdeYJqCiAqmb1hLU2hRPrrli6swU dcn+jzcDegPpn37+8/yX8S9pY+WGvH9B7w== X-Google-Smtp-Source: ABdhPJxXUM33reuR7l7g+CMp8DdKrEVgodZUAL6NFimQjOTJoNeF/PFVbP1CZyCWC8aZcB4vguoejA== X-Received: by 2002:a17:90a:b105:: with SMTP id z5mr9199299pjq.64.1634081804122; Tue, 12 Oct 2021 16:36:44 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:43 -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 v4 18/46] scsi: cxlflash: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:30 -0700 Message-Id: <20211012233558.4066756-19-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12554007 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 0B769C433FE for ; Tue, 12 Oct 2021 23:36:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E707860F92 for ; Tue, 12 Oct 2021 23:36:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236177AbhJLXiu (ORCPT ); Tue, 12 Oct 2021 19:38:50 -0400 Received: from mail-pf1-f171.google.com ([209.85.210.171]:36752 "EHLO mail-pf1-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236124AbhJLXis (ORCPT ); Tue, 12 Oct 2021 19:38:48 -0400 Received: by mail-pf1-f171.google.com with SMTP id m26so856461pff.3 for ; Tue, 12 Oct 2021 16:36:46 -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=p7c/8v1xt3D5oEXXreaW4P4ikASFZQurSEaOuBLHR64iLJDHpludND9OwUKjwiMrCu LO3vZNGL844Xpm+CXOGEYyh9I5u6s8WAwhSWXYUNz40ZU3jD+7B9Muce1XWj4eKy1xSp V10xPAYXHG58vmR5O34F2sDxIHLILJwuMFWTCrkqQSb9f+CjfuVaiLeGxW8ElDAVilai p2phP9wsKUqf7GTO6aSDGmCEzw6fdnc8TD/mmU8Zma5kjiF1rsHBOvXrm0KeYjSB+T5u oGD7WM7EzyLJxlSJHU9NCvqoKSmSHRrzazBQbplgBYJN3y2Jvs2BBT3PY7+ttJ4mAbbl k9Bg== X-Gm-Message-State: AOAM533Ocb5UzD/HmI8LtN2xYXv6pKG1b7ZvdLxnGCB1XqG8rzuj0WEL iI7A0iUXNQkNfSu9s4xOSMs= X-Google-Smtp-Source: ABdhPJzWPoY+1X7kNegc4Ra/2w7UyJI45XUVg6S3/QHzv9KrKe1IHzqC9KqYzGGf76HqwVPIS7Pfmg== X-Received: by 2002:aa7:8010:0:b0:44c:9d9:ecc with SMTP id j16-20020aa78010000000b0044c09d90eccmr34189844pfi.39.1634081805661; Tue, 12 Oct 2021 16:36:45 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:45 -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 v4 19/46] scsi: fnic: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:31 -0700 Message-Id: <20211012233558.4066756-20-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12554009 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 564FAC433F5 for ; Tue, 12 Oct 2021 23:36:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3FAD360F3A for ; Tue, 12 Oct 2021 23:36:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235893AbhJLXiw (ORCPT ); Tue, 12 Oct 2021 19:38:52 -0400 Received: from mail-pj1-f49.google.com ([209.85.216.49]:34785 "EHLO mail-pj1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236011AbhJLXit (ORCPT ); Tue, 12 Oct 2021 19:38:49 -0400 Received: by mail-pj1-f49.google.com with SMTP id ns7-20020a17090b250700b001a0937b87b7so2616277pjb.1 for ; Tue, 12 Oct 2021 16:36: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=7fS3vfVjSUAQtncOlTU0F2ED99R9H0HV+z+Q4ZYAT9k=; b=LnHKvxBKfsy1NdJJLi5o+x1hjQHcQXicCJeWfPFKGjCJrG8zZXVFL6L+sW9tKJVXuv B+7LjBKEyCxlRNuXmXap7KygT4sRqR+3Q6hwejFpxkmX8Eb/eT2TsvGCXkK9ZZmFG6wM zlWRbsj1xT5kx0HyYHkikRMinGnLZB+XjM6Fc91CRktWQKGnei/DmrEfGA+QPXzXziKC w33ybMsu8TKZtIt4SKuNOexs0tx9pewDDaaxkqSfmIByBDyO+wjEHUxwisrOeINA42ts VwI0yjJDAPZWpMv5qFp0nBpmfO4v0MPUcFiQxUBER2NZ1i4mBA+nY+0jBT3Pp7UIN7pi kDjg== X-Gm-Message-State: AOAM530P/uUuKbRqqZltC+tDmWmswiVhkVNmXFx5vlpWzcrzLaiRamD6 JMOuvlokWS3O4/i/P5Myx1Y= X-Google-Smtp-Source: ABdhPJzIzdUvv0lHt//8hoBPzV9AMix3RpeQg/cxfv07MUs3f/jrcFRyjvJv5JCjrCm5v5jbjNi3yg== X-Received: by 2002:a17:90b:1d0d:: with SMTP id on13mr9560017pjb.118.1634081807090; Tue, 12 Oct 2021 16:36:47 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:46 -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 v4 20/46] scsi: hisi_sas: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:32 -0700 Message-Id: <20211012233558.4066756-21-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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: John Garry --- 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 Tue Oct 12 23:35: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: 12554011 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 EE817C433FE for ; Tue, 12 Oct 2021 23:36:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D84C460F3A for ; Tue, 12 Oct 2021 23:36:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236129AbhJLXix (ORCPT ); Tue, 12 Oct 2021 19:38:53 -0400 Received: from mail-pl1-f175.google.com ([209.85.214.175]:41601 "EHLO mail-pl1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236140AbhJLXiu (ORCPT ); Tue, 12 Oct 2021 19:38:50 -0400 Received: by mail-pl1-f175.google.com with SMTP id x8so565562plv.8 for ; Tue, 12 Oct 2021 16:36: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=vzGDEg+jAZR7uGnvCWr1TcRbXzy6bDQwywzwfMVHUFM=; b=ut0P43ZsoSzMuv7c4kVepMv2m8jHdL6YPeyxB+rBvMwUwVYjQeOBV23yJvVhHvrK2u 6E3hoArGmbIVfUkfKzJ1cj2I0vrb7/XevcLDCeyS45nzT2jGhpAWeAzWmeiG4RU82mBn y5DAnEm5CGuydLvQIHP8UXZITFVpN8IiyAVob+XOrnnBxW+GaKmovP/OzYl8zb0T5dCy 4DhPseRvXkyKFafKiC1XeI150HJAwL84HXHvX8AAkAKmhXuPFHmkdaLN4H+Qmk9hKN4E HflOYhKZW7S0Lw65/Vaa0i7lB1wDDWU1pz8SuEDzO8k7EA6i8GiYmSShSnM4H8xuqW97 Lx1A== X-Gm-Message-State: AOAM532GhgjKenhdePq1x0AgrsafC8qquFvdzYTDeF/NiMaIUyV+ib5b kGzzItaM7Euv0gpTk8Ryu7UvjOoy7gxpPA== X-Google-Smtp-Source: ABdhPJwkBa8BN2Ajbg7rZ9skvs8hLomFaKD4FGmGjPYYuJ3LzZNUl3ScJnayV4eESa5xma6z94f3dQ== X-Received: by 2002:a17:90a:ec17:: with SMTP id l23mr9431039pjy.184.1634081808370; Tue, 12 Oct 2021 16:36:48 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:47 -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 v4 21/46] scsi: hpsa: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:33 -0700 Message-Id: <20211012233558.4066756-22-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12554013 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 8E1DCC433EF for ; Tue, 12 Oct 2021 23:36:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 77DEC60F92 for ; Tue, 12 Oct 2021 23:36:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236189AbhJLXix (ORCPT ); Tue, 12 Oct 2021 19:38:53 -0400 Received: from mail-pj1-f53.google.com ([209.85.216.53]:43779 "EHLO mail-pj1-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236036AbhJLXiw (ORCPT ); Tue, 12 Oct 2021 19:38:52 -0400 Received: by mail-pj1-f53.google.com with SMTP id k23-20020a17090a591700b001976d2db364so862933pji.2 for ; Tue, 12 Oct 2021 16:36: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=SVOj+z+fC+OkziZLouFRzUSU9wn71Bv1br5KDIOkAMU=; b=c2j80SyBS5laptV6Tu0BtuOZ6Tz2/oGWEggV0sELjW+o7on8oTOPoYA7XPzzFi5WiX 7fefaL4hjl06WRQc+6NqZ5bB2B7PioepQRQLV4JVJwrrZmHGjmZdKPMUAJiltF91Y3vf DtzDJTfsgLjf8sZ8DHS+RrjBbFPhgxwsNHIqPO86ZcYZLVzjuRQjM5lKRe1dqA4sT/Z6 yO2I1E0sDiaFf+6H1uLZ/Ry7hc5Q2QZxq4xIAN2Ui5GBcNLdhzoOWaC0iz8309GaJYl5 iP7lWbzVm8+OdktF/dnJupKeU1YCS3/hD0FD0MQ6GaSqxJ+/5ziLDGCOFHUsyUWWLLMZ Eqtw== X-Gm-Message-State: AOAM5306tW4xgCxJ47E7U4421Fvc3ImIverpPEFZ+wTy7Y9Frwigsu7G 2uxKetnkn1x610uyxc+ceQo= X-Google-Smtp-Source: ABdhPJwQzs4OBa81jqzsZXMogq8HHtA/5dtonjJcBkSEA5KyZwPgqLqhXyZJqD4G0GlglgDL6fBmsw== X-Received: by 2002:a17:902:bb95:b0:13e:6924:30e5 with SMTP id m21-20020a170902bb9500b0013e692430e5mr33144064pls.20.1634081809697; Tue, 12 Oct 2021 16:36:49 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:49 -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 v4 22/46] scsi: hptiop: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:34 -0700 Message-Id: <20211012233558.4066756-23-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12554015 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 EC249C4332F for ; Tue, 12 Oct 2021 23:36:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D32E160F92 for ; Tue, 12 Oct 2021 23:36:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236036AbhJLXiy (ORCPT ); Tue, 12 Oct 2021 19:38:54 -0400 Received: from mail-pl1-f181.google.com ([209.85.214.181]:34745 "EHLO mail-pl1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236176AbhJLXix (ORCPT ); Tue, 12 Oct 2021 19:38:53 -0400 Received: by mail-pl1-f181.google.com with SMTP id g5so588340plg.1 for ; Tue, 12 Oct 2021 16:36: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=kE5LxnwFISAmV7U8eafLq9RYsn5crmFkr10V2Fc9Pow=; b=lpP7iZSzrpHnQ0wuWMAG2883j/aRjOweLux2A3HjaqfaItwXHGMElyf8SKYBbpksUW 9rdxIgJnDIMCvfGWcUjReFG061p3WX0je+Sq7EoG4VXyfDjRC8qqmftxXgC8YSmHMCTM 8EsrtY5C9IFyc85QU/ZkiT9VdMWa4mBzDOPAb+eBXqbXJMEkM4+8vBMI6DcMRuoanJvR 7tqf8E+td893G8mJe8OfbHGLDzdloehY5pipBNxb9f/sQwliR0KrnfHxd1pMCE1W4GeK E6ElWIrZJaVhKeuKh6MwqzaqpJoG5wfA5NmgNyg8xkGETfB9A/Qeanpx0FA6CvpFFKEi Hr4Q== X-Gm-Message-State: AOAM532C+sLqbQZSVY9VygFH751/nxtQhSe02+vF0gfJCvvgT10fp/eC Vn3F/3bSHYLEwihBaS0SyFc= X-Google-Smtp-Source: ABdhPJw1YgmwYpdYKoHHXid/kJrT/G3cmN9s+huFQteIzqjlz5eGO61gcxVyexCMZznGslacVbXSRQ== X-Received: by 2002:a17:90a:39c5:: with SMTP id k5mr9556376pjf.211.1634081811259; Tue, 12 Oct 2021 16:36:51 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:50 -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 v4 23/46] scsi: ibmvscsi: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:35 -0700 Message-Id: <20211012233558.4066756-24-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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: Tyrel Datwyler --- 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 Tue Oct 12 23:35: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: 12554017 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 DBD1CC433EF for ; Tue, 12 Oct 2021 23:36:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C796260F92 for ; Tue, 12 Oct 2021 23:36:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236158AbhJLXi4 (ORCPT ); Tue, 12 Oct 2021 19:38:56 -0400 Received: from mail-pl1-f179.google.com ([209.85.214.179]:39599 "EHLO mail-pl1-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234129AbhJLXiz (ORCPT ); Tue, 12 Oct 2021 19:38:55 -0400 Received: by mail-pl1-f179.google.com with SMTP id c4so573153pls.6 for ; Tue, 12 Oct 2021 16:36: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=oPxm0WzT6vqmWC/6Ibhv1IqkIJD1vpHs2ypKVoufU7w=; b=uZbLTkCuZgaRtX0F8o9phLsGWsqExWHeg7EmhyvV6t/lKYX5eb2yB9C5srImAWgXjb 5iuX6sZX90RbZ/k0b/3NJTroI4T3t9yUCJOzbjvxpSxY42B96gZFYT8njfZQOIYD7kcD yYhmAJDZoL5eWLzvqCBAxn4Q6xUzh7iCmMX/6ciQM2Kgx0hza1GiynrbgzgE8uelGOOd BxJl2uoQfIAcFu9PGZI74Wgazf/LGB7fA0bZ79MJc2rpRpnDvtm67Z8eEIIjxRT2Z7SQ 1pTZ2tFp9PknWu21W7rMMRd25eWJAYd57mcAQWgSaVFq1JW8iat0mzPCLjU5TWW80Me/ s7fA== X-Gm-Message-State: AOAM533bcWnuY/ZShxn91APITNpaEF1F/X8hcV19Mfd45ytk9EDoEkXS ajx2eRzLjDa/KJLuDfki/UU= X-Google-Smtp-Source: ABdhPJzhkdRtyRQlmiYUtYgC1AxZAAKfYUCbA4rAeQHKEzeMLiO74Lvpj2c4iOtz9BlZpo+6/MRJmg== X-Received: by 2002:a17:90a:1548:: with SMTP id y8mr9763262pja.151.1634081812569; Tue, 12 Oct 2021 16:36:52 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:52 -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 v4 24/46] scsi: ibmvfc: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:36 -0700 Message-Id: <20211012233558.4066756-25-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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: Tyrel Datwyler --- 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 Tue Oct 12 23:35: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: 12554019 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 AD179C433F5 for ; Tue, 12 Oct 2021 23:36:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9A37460F3A for ; Tue, 12 Oct 2021 23:36:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236161AbhJLXjA (ORCPT ); Tue, 12 Oct 2021 19:39:00 -0400 Received: from mail-pf1-f173.google.com ([209.85.210.173]:40703 "EHLO mail-pf1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236041AbhJLXi4 (ORCPT ); Tue, 12 Oct 2021 19:38:56 -0400 Received: by mail-pf1-f173.google.com with SMTP id o133so835196pfg.7 for ; Tue, 12 Oct 2021 16:36: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=pL0XsSmLM0S09oS82IXJArEaSeEy2ycMIy/uO6hE6rk=; b=IcHGVvWZovK67kVPwoOStuzjNJCTCbPR97Dv6KO46ZWbAuuSBKud+eEBjQkfF1rwDq 0aYhyvAqKj+C0hUHI4bclcmIzeW6T3t8fBvkTJ/URwb5xRG+/wkWh33Ao4XZpQAldZmA 1iTPhPO/9RizauvEehncCHL1FERi4DdJG7oYNZx1YDv6qyMNVGuYj50rXgBj6IyOGW1h CZfPblW1MNBWdZwhrHGYuDwRpBob2lXOIhlNtQaUIvshA7ZyokWJ4/M4yBUC+YrXeiCn DqZS5N/ufC8/F/w6ZyGEDxAziKgUuMFB9bw9L5SXIeLiGREmGMaDEdD1x1mMnAdW4FB+ cqrA== X-Gm-Message-State: AOAM532q7NqZ9nlBJ/PANMM9J1y7ap3JE6OYXl3pHHesPfI0981CEsxC eaGOv183nOuurTi5cOk9V+k= X-Google-Smtp-Source: ABdhPJykYQBJuIe722enElXg2iMAKNlGTuRKEvWUfQf+ZT0GFnidcuNjtArHQig+kJjpUP+9eY4DpQ== X-Received: by 2002:a63:f84f:: with SMTP id v15mr25523699pgj.204.1634081813864; Tue, 12 Oct 2021 16:36:53 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:53 -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 v4 25/46] scsi: ipr: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:37 -0700 Message-Id: <20211012233558.4066756-26-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12554021 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 0DAA6C433FE for ; Tue, 12 Oct 2021 23:37:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB46160F3A for ; Tue, 12 Oct 2021 23:36:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236041AbhJLXjB (ORCPT ); Tue, 12 Oct 2021 19:39:01 -0400 Received: from mail-pj1-f44.google.com ([209.85.216.44]:35386 "EHLO mail-pj1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234169AbhJLXi5 (ORCPT ); Tue, 12 Oct 2021 19:38:57 -0400 Received: by mail-pj1-f44.google.com with SMTP id d13-20020a17090ad3cd00b0019e746f7bd4so3077074pjw.0 for ; Tue, 12 Oct 2021 16:36:55 -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=UplI3d/+DL2pup8Woc0Twm3yLvlVHtgAUCQSepDYVTkUDpNVb1jXoaMbk3nkom2oTo SbQ30Fqyg/qq46eEKaGggBHpsEE8Y4FlXFdPCvrAXltiJ75AC3jy0RqHhC4hy4Wj2nHF A6US5jtRmoATd8nH39hMjdeVZ1dvlEV6WuiUHaG5BwTARckfh58TgNQt66M8TDvc4AqM tFdMk3vP1teXGzHfSFBKMMqqGMVcZ5kvqSYGqZZnUJ90ruDeu9jrnf81BUvNVyTOIZIf bouG5C7tFaoVoVF764HkRHiPeMz5MmHImPlV/+2y9Mo1xYVq0wJkaqIxAf+gUP3zxOFf Jh9A== X-Gm-Message-State: AOAM533ISCUo1SF16u8I8lcLhxq8ynh78jZ5QOV7fxj8VKw9uDvR3JO1 iMw+rmigOOfbslpJfSpFpSU= X-Google-Smtp-Source: ABdhPJw+gVtujmUJXcukZcoVsYNBazBhc10yTi720d8alnJU65cq6VoqJsSBMAiclMF1yn96AJUxdg== X-Received: by 2002:a17:90b:390d:: with SMTP id ob13mr9623573pjb.50.1634081815205; Tue, 12 Oct 2021 16:36:55 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:54 -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 v4 26/46] scsi: isci: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:38 -0700 Message-Id: <20211012233558.4066756-27-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12554025 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 9417CC4332F for ; Tue, 12 Oct 2021 23:37:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7B31860F3A for ; Tue, 12 Oct 2021 23:37:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236098AbhJLXjC (ORCPT ); Tue, 12 Oct 2021 19:39:02 -0400 Received: from mail-pg1-f171.google.com ([209.85.215.171]:38665 "EHLO mail-pg1-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236132AbhJLXi7 (ORCPT ); Tue, 12 Oct 2021 19:38:59 -0400 Received: by mail-pg1-f171.google.com with SMTP id s75so554684pgs.5 for ; Tue, 12 Oct 2021 16:36: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=HuPqne0Wah5BGBFKPQNKjpg6x1gUcuK25zyOnD8wkyQ=; b=MP8rsrRfD+PdvL4axOS69hDlVlmTUsB1k/FO9LPbsdwECjBSBPjx6YlyWF+SxpKjxi 5baluntPzIuUzncXdpAS/yVHlY5jwCUnHycl/TiUcbaf1HElvHcIaMQXLXdAdTchFghi ja90gQ69LAO3XZ0G3j/SqWdImE0qnMo2IIZlenEQs4aByKS5bBu1+I4Ey0tgCX/F9sju bhm7VRGkGL6uPFakHbbmM5w/G4Pz2xOZBz7KoM+hbkEl306Vm1IwD2NKli98mh7yY7bS +f+Q2S3vk5uv9qurpG8OjYk7fXZtvn6st7+kQtbLP01yHhykv+HDoKOh+BjZgAH48GbY lGFw== X-Gm-Message-State: AOAM532/YnbuIFDfFQlV778G/iFSfRqcN10Row+hchDMlov0Mk96s9Tn +OFnixEDypga2FVAlT+URiA= X-Google-Smtp-Source: ABdhPJx5JxryMynUW7JtCBaLkVKbBf88u6IsKdhm13hD+nwSWNet/X4pW4OSdE4NXoBZMcAmwQjOSQ== X-Received: by 2002:a62:61c3:0:b0:44d:2518:cdf1 with SMTP id v186-20020a6261c3000000b0044d2518cdf1mr12154400pfb.31.1634081816842; Tue, 12 Oct 2021 16:36:56 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:56 -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 v4 27/46] scsi: lpfc: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:39 -0700 Message-Id: <20211012233558.4066756-28-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12554023 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 5B389C43217 for ; Tue, 12 Oct 2021 23:37:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 472C460ED4 for ; Tue, 12 Oct 2021 23:37:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236185AbhJLXjC (ORCPT ); Tue, 12 Oct 2021 19:39:02 -0400 Received: from mail-pg1-f174.google.com ([209.85.215.174]:45834 "EHLO mail-pg1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236114AbhJLXjA (ORCPT ); Tue, 12 Oct 2021 19:39:00 -0400 Received: by mail-pg1-f174.google.com with SMTP id f5so525575pgc.12 for ; Tue, 12 Oct 2021 16:36:58 -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=jopbaCt0xYgr+uV0HYDg/9r3vYXJH39m9+ZJxXEq//MgRPHbEUqR6gBXn66YvTZ++T 1yoAdpsZxmJTxyst6ohlozmVJdmGB6lvu2BkRbv8H5ypscDwBelNPPzPpqT+kZGPU9u+ oyc7rqiGPJRUxWsQpU+lIiRtEo/hYzNxSatwqASYgF5SXYAqNPJjiZf5UbgdIZj4QQP3 V3iesh5HeDnwDCKcLEmTjo+2aqYSdZMRcnHWUFHaHiQrSn2UB7SkfxUN3+BcTYTZbc3v Luy9zh+dcxlxU4CVp6OKPnCjA12WKUVNKEb68jMvAfmLHvsm8X1bgiz0kajMb+8PKP+7 QC6w== X-Gm-Message-State: AOAM530+wRpVcIVePYIvzoaD6XeA+a/6kBBlp4zXhvqOI3e3ja7EaWiH +6z3oWlYamOFVw+gtrEQqbw= X-Google-Smtp-Source: ABdhPJyLS0mb9drgP1nalFtqpk6XhPgDa9Cgb6Y/4B0nJpJoiFltbtBK2hnQwGXzyG1OvavG5Mw0+w== X-Received: by 2002:a05:6a00:1944:b0:438:d002:6e35 with SMTP id s4-20020a056a00194400b00438d0026e35mr34227612pfk.20.1634081818408; Tue, 12 Oct 2021 16:36:58 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:57 -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 v4 28/46] scsi: megaraid: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:40 -0700 Message-Id: <20211012233558.4066756-29-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12554027 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 C632CC433F5 for ; Tue, 12 Oct 2021 23:37:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B63E360F3A for ; Tue, 12 Oct 2021 23:37:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236114AbhJLXjD (ORCPT ); Tue, 12 Oct 2021 19:39:03 -0400 Received: from mail-pf1-f171.google.com ([209.85.210.171]:45005 "EHLO mail-pf1-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234129AbhJLXjC (ORCPT ); Tue, 12 Oct 2021 19:39:02 -0400 Received: by mail-pf1-f171.google.com with SMTP id w6so817336pfd.11 for ; Tue, 12 Oct 2021 16:37:00 -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=kYWlw5NABa/hZaJS5EWKdTkL9qD7jbZ6qqFpqG8j2H41i86XRrAXw5O3ap8rNVrNU/ 63pkzikP2x4EOz2BdsyOsVTfiAtXahpGFNAymD9odRRFjw9QTQlxjVO8BGm1Ya4zeOaf E8SbsEFOrOb0ta5V4lenD0Xczv6B/Zu8Zm8BF2UBzbtNDkp/P6LWbx9K7yRneKB+Wh/d 0XVPxzC9NztRW5G3zeeKzwX0EcMhp70RNkBE4KZ04g7Fd9IRN22QSIpGMKJWEygLcKMc jwaAyp1E2eKMQT5qHEW56OcAneAxLYnZaNsJm0rkCnw16wUyICP8wLmcv4Kwbuhn74w7 nyMw== X-Gm-Message-State: AOAM530P8EjdJ6MkiEgJirsx4JRBk0XUpWK0xxNHj7Twf22nKFDypoxK ZxzWRJz7QaLhKmzDVEFEDtY= X-Google-Smtp-Source: ABdhPJziBzxqbAfZOdfMMnQ9OE4+mXI5mG2bQkZcrlBBX+CCFoOguuBvHjNXaEpJ/h3rWrrlyBwAfg== X-Received: by 2002:a62:7e4e:0:b0:44c:51f5:5895 with SMTP id z75-20020a627e4e000000b0044c51f55895mr34398389pfc.73.1634081819929; Tue, 12 Oct 2021 16:36:59 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.36.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:36:59 -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 v4 29/46] scsi: mpt3sas: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:41 -0700 Message-Id: <20211012233558.4066756-30-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12554031 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 46654C433F5 for ; Tue, 12 Oct 2021 23:37:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2A4E160F3A for ; Tue, 12 Oct 2021 23:37:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234129AbhJLXjJ (ORCPT ); Tue, 12 Oct 2021 19:39:09 -0400 Received: from mail-pj1-f52.google.com ([209.85.216.52]:46799 "EHLO mail-pj1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236205AbhJLXjG (ORCPT ); Tue, 12 Oct 2021 19:39:06 -0400 Received: by mail-pj1-f52.google.com with SMTP id pi19-20020a17090b1e5300b0019fdd3557d3so829016pjb.5 for ; Tue, 12 Oct 2021 16:37: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=q/iwhY8URVTeMCs+2vc+hIQceR1frC9+0UnoeCjR46U=; b=g6mukVZ0xrv8KOKqSkQfGhl6u5Ink6ZfiM8YzXVtdqLDGfk6V5ClCB2/KOZJw8+XCu BfksWFwKN1Kwe+fWOcmRAoaKChe1kADhi04co1gHI6QHwng0NGBhckoSItDtIij6Qv9e fAVsjO/wbzuN3xdiO15QA+/3KCzCE3OS09dyaF1G4hpnPVe8/pUGAfxyWRtWOBoGUL12 19tQ4sgpiXbuXsUgilyhO6EpZeq3FsSY9gC0ms5KYYFZhsgss2ofJe7rPZpXJDV7wAb3 1OCwZmBcJWyNG3ywaWQSJoFUIXuDyU3gsjXqIT2+oizC3C9ytd6OQUGpD9DOI0LtR02n 8FSA== X-Gm-Message-State: AOAM533jfUBxH41drR9y3BS/NTCIzoW1jhS8b+KVJhij7r87xtaUOR+E 2gj8r9y9PXx77P4PgZswxxw= X-Google-Smtp-Source: ABdhPJxzrtGQyWryT9aWkQmE10jkAhP1iJryUSGJhQFFokU5p5cJPSbeKqlQfNWLwqGmS+aqYaBlsg== X-Received: by 2002:a17:90b:3ec3:: with SMTP id rm3mr9446010pjb.186.1634081824383; Tue, 12 Oct 2021 16:37:04 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.37.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:37:03 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , "James E.J. Bottomley" , Jason Yan , John Garry , Yufen Yu , Zhen Lei Subject: [PATCH v4 30/46] scsi: mvsas: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:42 -0700 Message-Id: <20211012233558.4066756-31-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12554029 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 BCB0EC433EF for ; Tue, 12 Oct 2021 23:37:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A2F9060E54 for ; Tue, 12 Oct 2021 23:37:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236205AbhJLXjK (ORCPT ); Tue, 12 Oct 2021 19:39:10 -0400 Received: from mail-pl1-f174.google.com ([209.85.214.174]:38699 "EHLO mail-pl1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236176AbhJLXjI (ORCPT ); Tue, 12 Oct 2021 19:39:08 -0400 Received: by mail-pl1-f174.google.com with SMTP id x4so576168pln.5 for ; Tue, 12 Oct 2021 16:37: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=24FcnP76JVFRjuZBpToKuYhGMB1lsEL0njGDm4SiUBM=; b=QBH2qFwvxFlfbvPXm/C3+u2ipkY3pGBNOCdvLKLT9lBduUwEvolSES5s8m7+/deMEN ZyhsLGQBBFXqAnxAt/GJtn0on9MM+Y/5ShYrZHY8dwBtum/i0m3Ia44BXLVyuvDl5J4+ Oc4nXr+/w4rnRVtGS4cDFb/WS7kWxcgV1s7Q8Bp2tjQZlEA6u6N4MdyhV3Uoo4emAAmz sKImqsrnQkcz5NipYwDxrRXXMAjMXFqriuxwn6gannC43i3Cm6kHeZ7TzSbuO0hGYmx0 NS85q24HRdb2fS5evs71a4seOpB5ZSRovSaSheXrdIuJeZ8zLCxTdbafT2H21Cbr1MGb CDEA== X-Gm-Message-State: AOAM533UAtFcNildjEU4SdZMYzjtXxzZbTsrJTIjJzJ6efsQcQohgmZ3 J+YOJjO65v+KwkW6AbP8/BI= X-Google-Smtp-Source: ABdhPJyxv7RCoq0RJqGQNrTQ2ZkVe/R+RP57iI7Q7eJrAXAnPYmh3FLslolUOi6aGVUIuI/EXXX0lQ== X-Received: by 2002:a17:903:234d:b0:13f:3180:626a with SMTP id c13-20020a170903234d00b0013f3180626amr15769717plh.49.1634081825691; Tue, 12 Oct 2021 16:37:05 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.37.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:37:05 -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 v4 31/46] scsi: myrb: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:43 -0700 Message-Id: <20211012233558.4066756-32-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12554033 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 A951CC4332F for ; Tue, 12 Oct 2021 23:37:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 965C960E54 for ; Tue, 12 Oct 2021 23:37:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236176AbhJLXjK (ORCPT ); Tue, 12 Oct 2021 19:39:10 -0400 Received: from mail-pf1-f174.google.com ([209.85.210.174]:43614 "EHLO mail-pf1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236249AbhJLXjJ (ORCPT ); Tue, 12 Oct 2021 19:39:09 -0400 Received: by mail-pf1-f174.google.com with SMTP id 187so821249pfc.10 for ; Tue, 12 Oct 2021 16:37: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=EUe+T7BRbW2HGNCh4VxgcEN8rcNEKp+5yJ/I85ScS7k=; b=GpqkwCZ8pwh1Quz1DtPN9ua6iRX5znMeiVKugLWvoSq0IBme4ZVWSMackUtBj7pf0u 3VSUGY1RQjqYG96VoI8ffa8NmAKU5E1z0NO9OTz/3mmJ1GGg1j+mM7JdLsa3H7LAM7CE 8l+J7qExeMMDL7FSH/1/48+bSIZssXWlANyhu2d6+RRfsH102ecwgsrBvg8EvP32fe98 NajUhi8wI7LJmavhcApq4HItA+2iTvVvRKcXKVjHBLRbGAWDyKXIaBgQIZdaPdNa/VZm w8FeimFPCnSnY0VMAhlnKGKAMiYVPlKiF2VMaP1dpeLQgDcVjSt9aQFKDslKnmkPN3pZ 7z2w== X-Gm-Message-State: AOAM532kzD+DTMeofkTdPnF1sJEv5DLGAlfKX6mLuHj4qo0eXysMVdW5 6tKrIB9zw4QhGlm/2qd1V5BsfgmDLEjNNQ== X-Google-Smtp-Source: ABdhPJzJl8cTw5Yu9ln3IHKFfGmFc7Eb7uV1PQiIMN0Ev7Xoc/Wz3aCK8FL34LprEpKiA7x5/pwLag== X-Received: by 2002:a05:6a00:1242:b0:44c:2025:29e3 with SMTP id u2-20020a056a00124200b0044c202529e3mr34460755pfi.59.1634081827007; Tue, 12 Oct 2021 16:37:07 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.37.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:37:06 -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 v4 32/46] scsi: myrs: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:44 -0700 Message-Id: <20211012233558.4066756-33-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12554035 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 3B937C433F5 for ; Tue, 12 Oct 2021 23:37:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 23FF060ED4 for ; Tue, 12 Oct 2021 23:37:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236273AbhJLXjN (ORCPT ); Tue, 12 Oct 2021 19:39:13 -0400 Received: from mail-pj1-f54.google.com ([209.85.216.54]:41757 "EHLO mail-pj1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236188AbhJLXjK (ORCPT ); Tue, 12 Oct 2021 19:39:10 -0400 Received: by mail-pj1-f54.google.com with SMTP id na16-20020a17090b4c1000b0019f5bb661f9so898275pjb.0 for ; Tue, 12 Oct 2021 16:37:08 -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=KhUBOeI5uiqMShfmncQljtxnjbz6Pe39o3iTTMDIjPuV2u67DYlLjJYWJpy9ZWC0LD +YV366HBQX47uHKzTzlvt1hlwbsI5RhRgFSpkuW7Cp8c/Jw7JWX22K/yvPH/HRpeXWfk Y7t0T/pptj9sX60Xj1ogNpOQ6T4H4jHmKdc4Kiak/gpQf6bw1jxgUKg2tbm13M2uIGao exkSKkBCzhHRsHDuJx4LpOUXXGygfuDZSZMynXlPb/d6o0W782nsIvx8cIL+uB8OiSZr GbhsMh1eoKNZoVS32CQqkMB8ZxdZ4pT0z/Rv1Oq4uOkNGpbdL0IgsW1kIMn+gUvkxLyh IGlQ== X-Gm-Message-State: AOAM531uZ9jJlAG4pa3cZzN119miHJnta52vrVSMyGfp+pBRoE2HLlM0 z1+6DtBgACgBYW6oHnzrxUnpupWw75g4kg== X-Google-Smtp-Source: ABdhPJzFL8ENMIv+GnGSvNoAJO8U97XSONMNHR/0qfZn6jh0txzBxO27DA/uvc91E4kPvulmqe11Ng== X-Received: by 2002:a17:903:41d0:b0:13f:1bbf:1535 with SMTP id u16-20020a17090341d000b0013f1bbf1535mr23757270ple.52.1634081828287; Tue, 12 Oct 2021 16:37:08 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.37.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:37:07 -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 v4 33/46] scsi: ncr53c8xx: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:45 -0700 Message-Id: <20211012233558.4066756-34-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12554037 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 323B5C433F5 for ; Tue, 12 Oct 2021 23:37:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0DFEF60E54 for ; Tue, 12 Oct 2021 23:37:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236054AbhJLXjQ (ORCPT ); Tue, 12 Oct 2021 19:39:16 -0400 Received: from mail-pj1-f45.google.com ([209.85.216.45]:51156 "EHLO mail-pj1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236216AbhJLXjP (ORCPT ); Tue, 12 Oct 2021 19:39:15 -0400 Received: by mail-pj1-f45.google.com with SMTP id k23so847286pji.0 for ; Tue, 12 Oct 2021 16:37: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=o/KCwi6Jatb0W2TFXLG/+J51xr3UgQp4E1sK00H0/tY=; b=n/p0vvL8ez4dh3a2FEsFupH/JoN7bsnlJBrZziG/bbgEpfPj5z9/NKIp0gShVhJ6rw gOi8iv4eVkryZUObdwFfcT7qmbl0Lw3IhqZ7y2T1hpvUFCNtO6y3sb2042LAZmgOS6ta X7FJxwiLDK2iIcEyclpDRAhlmZ2QhU6HbFZHlPDctLqsGKfrAnGN0oKUHyu18AXtP62I 4tGJtOTcgB5+nzDJHJByKIRd8aXNECwg6rDh5MfL8sbNg9kjpvm6Anch3cpc1WgZ6S73 jxSyVohJWUMfywXqFL5vlvf3WlU60NnyjKoll7vctp2BzkI0zGjW+fmCquCxrGkGQzeb bHEQ== X-Gm-Message-State: AOAM532PKUNzSa3A9/zTTq8VnZLbDKxDq8WpSn+98+Qth63y5HUKoNVv kJfUO9POxlgzOSOmAM26i8Q= X-Google-Smtp-Source: ABdhPJzn44/KAVjo0SGbW+f3APwHroDTlnRYnVBaniCOlKDd6y40v2uMCnJt9DZrtXNt8lW+r8At3w== X-Received: by 2002:a17:90a:191a:: with SMTP id 26mr9701595pjg.79.1634081832569; Tue, 12 Oct 2021 16:37:12 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.37.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:37: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 v4 34/46] scsi: sym53c500_cs: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:46 -0700 Message-Id: <20211012233558.4066756-35-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12554039 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 154DFC433F5 for ; Tue, 12 Oct 2021 23:37:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ED97C60E94 for ; Tue, 12 Oct 2021 23:37:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236177AbhJLXjS (ORCPT ); Tue, 12 Oct 2021 19:39:18 -0400 Received: from mail-pl1-f169.google.com ([209.85.214.169]:46794 "EHLO mail-pl1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236214AbhJLXjR (ORCPT ); Tue, 12 Oct 2021 19:39:17 -0400 Received: by mail-pl1-f169.google.com with SMTP id 21so549048plo.13 for ; Tue, 12 Oct 2021 16:37: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=/explWihP61Cdyq8y78LtpWekj+7uWmg2F2XGcJr5bk=; b=dDBpYpQGH1LOCx/gUsuIuLyD/uugLdIRKInGi1AGUKHhC13teyzxatF4c8+07T/ZlL RdloY8Wvgl8gwRC1lB6GVldn4ocO2h7a0qCL6ODbtQQ9/k0tqhOhi3XgZ46PcWRpW2LP N2/4U5nt7ZBPrD6XDNtY6dcf38VZI1v4z3s3vQrlCO+oqiLoWUzUej3ak96N9A+vE8tm U1FQz/2MmCbNegY8DQ2BzYpxnfk73BIi0VT04+SfkX6pkD13QPwUrd+IgntXEi/xaZsM HXukT+PxIaCyF8rpjWRjxaYcgZ02FL6Q+1oN/JaQutmxtDvnMUxFXz4Ndx49WwSEQSxw 9wzw== X-Gm-Message-State: AOAM531fctV9182Gyz77ChurGIrMpYWSWoQgE5kMyqhZJHbBTIzmJoVK Odt07vCnlEnSyokNcwg4Dus= X-Google-Smtp-Source: ABdhPJwOVVd9lfeZ9pKw3fnF1bygSEw0WMOWW17FfTq5cFzxrQo5kjuQBoizuKe90LUaLSlYPBdMWg== X-Received: by 2002:a17:90a:db14:: with SMTP id g20mr9397789pjv.43.1634081834063; Tue, 12 Oct 2021 16:37:14 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.37.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:37:13 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Jack Wang , Jack Wang , "James E.J. Bottomley" Subject: [PATCH v4 35/46] scsi: pm8001: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:47 -0700 Message-Id: <20211012233558.4066756-36-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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. Acked-by: Jack Wang Signed-off-by: Bart Van Assche --- 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 Tue Oct 12 23:35: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: 12554041 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 A1E37C433EF for ; Tue, 12 Oct 2021 23:37:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 89D8F60EBB for ; Tue, 12 Oct 2021 23:37:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236216AbhJLXjU (ORCPT ); Tue, 12 Oct 2021 19:39:20 -0400 Received: from mail-pj1-f43.google.com ([209.85.216.43]:54039 "EHLO mail-pj1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236071AbhJLXjS (ORCPT ); Tue, 12 Oct 2021 19:39:18 -0400 Received: by mail-pj1-f43.google.com with SMTP id ls18so796049pjb.3 for ; Tue, 12 Oct 2021 16:37: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=ttBrfGfVvdCJO0vAdUa5pmDj9rhhdRZtsp4QZiZrF2U=; b=cNWbRYNCt1sIzXX2NYBqOGaaGQSzgUzHeXXUj4+/pZWHxQqCbWdl14iZJ41aFkTDU4 FwbrRFFVAmZc0kyXFw0mfpWR9vXdWLfYv+MRyoqandpa7uBqizic3hGDYv1oJXFOQYIo srzlGFcX4kW1YJSmuULF1Ca3yyMzNNbinU7qRylmkLVndATfRW9Bu82oRh43j3o9bv75 E4wsEFCtrzixRF8BdCcG18pfao4gLkS5gfi11/qsGidNG7E2h9Mqpw8JdQem+xmJliLY giyKAQHqP50BBvwIdeLyeVbDIGeO8uvPLS0iRr2LY34susT/+/JGYvjs+773gHp9t6a6 A0ug== X-Gm-Message-State: AOAM5317BC1QTJ73qudZUYyAPVp1DAk9ipMRMttqd4hKNv7z5BjV+knX TqFtOfzGDMXt2M7ylxYHqfebwig/UGIskQ== X-Google-Smtp-Source: ABdhPJwYcJAzVXbyTph0NtDTfv3PaahGecREN1Vs2KdQOi0ZpZJMwrDegPYzFA2z2h054yh75bEYVQ== X-Received: by 2002:a17:902:d88d:b0:13e:807b:d52b with SMTP id b13-20020a170902d88d00b0013e807bd52bmr32636032plz.69.1634081836350; Tue, 12 Oct 2021 16:37:16 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.37.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:37:15 -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 v4 36/46] scsi: pmcraid: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:48 -0700 Message-Id: <20211012233558.4066756-37-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12554043 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 E0C9DC433FE for ; Tue, 12 Oct 2021 23:37:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C4AC460F3A for ; Tue, 12 Oct 2021 23:37:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235841AbhJLXjW (ORCPT ); Tue, 12 Oct 2021 19:39:22 -0400 Received: from mail-pj1-f42.google.com ([209.85.216.42]:36722 "EHLO mail-pj1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236214AbhJLXjU (ORCPT ); Tue, 12 Oct 2021 19:39:20 -0400 Received: by mail-pj1-f42.google.com with SMTP id qe4-20020a17090b4f8400b0019f663cfcd1so3053673pjb.1 for ; Tue, 12 Oct 2021 16:37:18 -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=4vhWAudC5g8uVi6hIomIehwFDhErSmWokinTsXh3dUWbriyECRKKgxMEP5JHc4SrKm vLRTjl4A5hHDKBsQzGBKGUXFw/8sLCGwXcsgvkEsxcNfnp2aVHNhfoCBoXoDMTssd94r XkBlzIkbM2DIOA7afP7AEwT59ZudBz0PcK21aIzfvTIFbgixZu5LTQB/tsMBpCU7LubW PnxnA/CHXD3eLiJ/BXW+EnoQbZU+uiNSYj/U7ZkYCJqUcgtil3iBRq/qXU6yVzW0204D uKaAt1GFdMPMwryUmY8L9nQswM6+h4qNslxU9cdq0ygwr/MrBDBXpNc1lwACC2b1mfmb fYUw== X-Gm-Message-State: AOAM530iSdRyLHmurRzrarcShkjKOqlZNNp4cVApKHsk6Fjj1jGaQhjn A7Lxhbz0rZuCj5s6kw5553c= X-Google-Smtp-Source: ABdhPJwvwS6mHCy5WxjV3STGGhzXGv//qLCYEjenWtfw+cmzcZ27y+t57yDT4jcr7TwE2/onZpXkZg== X-Received: by 2002:a17:902:ec82:b0:13f:663c:87cc with SMTP id x2-20020a170902ec8200b0013f663c87ccmr811507plg.24.1634081837881; Tue, 12 Oct 2021 16:37:17 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.37.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:37:17 -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 v4 37/46] scsi: qedf: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:49 -0700 Message-Id: <20211012233558.4066756-38-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12554045 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 03D0EC433EF for ; Tue, 12 Oct 2021 23:37:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E16B660F3A for ; Tue, 12 Oct 2021 23:37:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236240AbhJLXjW (ORCPT ); Tue, 12 Oct 2021 19:39:22 -0400 Received: from mail-pg1-f182.google.com ([209.85.215.182]:43766 "EHLO mail-pg1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236071AbhJLXjV (ORCPT ); Tue, 12 Oct 2021 19:39:21 -0400 Received: by mail-pg1-f182.google.com with SMTP id r2so534006pgl.10 for ; Tue, 12 Oct 2021 16:37: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=0ZTBxLPqSs/6i0U7e7XZcvzD63NIy196LVs1TUn3088=; b=5KcUfU65oC3QXFIa17S5cdcrldm8K9zCf6ObmDge616paBTzTdzPKuZuPWtx8qzzdA EaRHmfhPqHBKQa3U4sFlCWQqvWLkcvnvj16Rp/fEs07j64EEgZg3qGNOtxzFKFX9Ig3/ PvfnIchShdTPFc/XlVs4UsTB0BY+jddiYDuuoC2mY5xJ6xLGkG+MlPOr21ymhapCOhRX ZqZACQ5usQq8oi/+TxBTzP3ZFY6t7noieUAYlizX9QzE83M6mMs6K5yaCdKitkGabKbm c9Ak7WNseoHHjC8sKKhbF5XCDppDOoMp7LbcjHbl5cxbUi+pNql2WCqRlTvljt8EWWlj Yocg== X-Gm-Message-State: AOAM5328ngb/7x0rMpEcditS9s+uW0+3kRQSw3nA0VwmDD4sshrxe+jk xXthZqq5fNO6yfN5mj0fwE8= X-Google-Smtp-Source: ABdhPJxoTokgWXoPD/1YXS2TKfEs+0/hYvyx6bSvoen1mIbm/Srg7e0Xy0Wbyix2VgbheyUtWgH6BQ== X-Received: by 2002:aa7:8b1a:0:b0:44d:37c7:dbb6 with SMTP id f26-20020aa78b1a000000b0044d37c7dbb6mr7843180pfd.11.1634081839402; Tue, 12 Oct 2021 16:37:19 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.37.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:37:18 -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 v4 38/46] scsi: qedi: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:50 -0700 Message-Id: <20211012233558.4066756-39-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12554047 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 D9D74C433F5 for ; Tue, 12 Oct 2021 23:37:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C08C260ED4 for ; Tue, 12 Oct 2021 23:37:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236303AbhJLXj2 (ORCPT ); Tue, 12 Oct 2021 19:39:28 -0400 Received: from mail-pj1-f53.google.com ([209.85.216.53]:53149 "EHLO mail-pj1-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236071AbhJLXjX (ORCPT ); Tue, 12 Oct 2021 19:39:23 -0400 Received: by mail-pj1-f53.google.com with SMTP id oa4so814508pjb.2 for ; Tue, 12 Oct 2021 16:37: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=+zV95fuzcw/1F5E6I+0GGTqawzS1QjJLjxm6SJSTdxs=; b=IPjI1ZLzbiVcZ2VKtmKd0aV8+d/yznGQb0IXvxSbM6Ny6qvsrv8G3jO5YxJVqHrzET PiDGJ/mzJyBrBcJKIPxOgraaUCjQuvJKsdedMw/pIDD1voBG06He1sHbWfr53YvqcQlC KnWUUYdIun9wWWJCL1OsSHOxFiwj9Vo7TJfOnk37Urp2nxRuSvTj/mSUk0UQ22pnzVyb RASInZqnnS/Xylt8C3LWB5UitPBXKzk01jgbD0+k8LV5z2EJ0Numuy4tDC8Ynju2Evfw uRqIF7Q9LsR5SoRKyBXQazg2+IOIOum58oe6oM3BbpVadML5USBR0QOXI6WnkL1GIIcn G2cA== X-Gm-Message-State: AOAM5327cA0syBeyQViTD2H5BkiLQjgK5butjAK7OmvJASsoxMwklePU lcMNLMN34uAV9SXQXaAA6Qc= X-Google-Smtp-Source: ABdhPJyJ8BapE44ZgkdKuDYOV0vs4gLIbvun8+EW6TgTA4L8JZO9EbmUogGTavBx2/jKQmnacnNvLQ== X-Received: by 2002:a17:90a:290b:: with SMTP id g11mr9255723pjd.35.1634081840759; Tue, 12 Oct 2021 16:37:20 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.37.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:37:20 -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 v4 39/46] scsi: qla2xxx: Remove a declaration Date: Tue, 12 Oct 2021 16:35:51 -0700 Message-Id: <20211012233558.4066756-40-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35: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: 12554049 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 C269BC433FE for ; Tue, 12 Oct 2021 23:37:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AC5E160ED4 for ; Tue, 12 Oct 2021 23:37:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235840AbhJLXj3 (ORCPT ); Tue, 12 Oct 2021 19:39:29 -0400 Received: from mail-pg1-f172.google.com ([209.85.215.172]:42959 "EHLO mail-pg1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236249AbhJLXjY (ORCPT ); Tue, 12 Oct 2021 19:39:24 -0400 Received: by mail-pg1-f172.google.com with SMTP id 66so538223pgc.9 for ; Tue, 12 Oct 2021 16:37: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=D/Ac2I+8O3KqNwk6eUFfAkswjNKflitnqb1Y2vJE2Zc=; b=p3H/4mb442rCyaxEXavUSHbtSXYSLspUcr3zZv7ZjuyJ0cgSsEoVCKoj0fagg/z/VW KZ+DRPEX/ObgsZ1CFjSb9OXFMv9tuUgMP/EQHURhCHs06MiJpcwrNRp4P8aUpURRqpd2 bTRcSXsekkvQz0DcSI9FuH5C36lra/bATWRGhwP70j6QcygciNN8/UhkJO4YwEdm0Hod m8HawVDe2xwxDtydEti8sPTPGTRG5BTSZNfHABV6S3FZrKU+mPuwr6iWFJuRSpUvGxid UH/2DVd8l7ghwC3IQg51/3GyPGGPYz7ob/7BOAQdPBk6zc21h+M0lPu8ZIvvfVpMVWEL YyRA== X-Gm-Message-State: AOAM5308TX1Sn1foe4Uc6n2pkUwV+4wewHGFTKZkpAoZ4hf+ITagvrhw VD2PRVBAEadZkmYIS3xOArhTzkfFxIzzoA== X-Google-Smtp-Source: ABdhPJw9bROe8USAt2CujyOnvEc3lbTkWrVKHkpnP+bHBO319zhbL1rjJNCgfxj+G4RUvUERLL5vKA== X-Received: by 2002:a05:6a00:1634:b0:44b:7184:5ec4 with SMTP id e20-20020a056a00163400b0044b71845ec4mr34288470pfc.40.1634081842206; Tue, 12 Oct 2021 16:37:22 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.37.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:37:21 -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 v4 40/46] scsi: qla2xxx: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:52 -0700 Message-Id: <20211012233558.4066756-41-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 | 125 +++++++++++++++++--------------- drivers/scsi/qla2xxx/qla_gbl.h | 3 +- drivers/scsi/qla2xxx/qla_os.c | 5 +- 3 files changed, 67 insertions(+), 66 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index cb5f2ecb652d..30f9545d2285 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c @@ -2481,72 +2481,77 @@ 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, - NULL, /* reserve for qlini_mode */ - NULL, /* reserve for ql2xiniexchg */ - NULL, /* reserve for ql2xexchoffld */ +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, + &dev_attr_qlini_mode.attr, + &dev_attr_ql2xiniexchg.attr, + &dev_attr_ql2xexchoffld.attr, 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 (ql2x_ini_mode != QLA2XXX_INI_MODE_DUAL && + (attr == &dev_attr_qlini_mode.attr || + attr == &dev_attr_ql2xiniexchg.attr || + attr == &dev_attr_ql2xexchoffld.attr)) + return 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 Tue Oct 12 23:35: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: 12554051 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 28652C433EF for ; Tue, 12 Oct 2021 23:37:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 10AF260E94 for ; Tue, 12 Oct 2021 23:37:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236254AbhJLXjc (ORCPT ); Tue, 12 Oct 2021 19:39:32 -0400 Received: from mail-pf1-f171.google.com ([209.85.210.171]:46808 "EHLO mail-pf1-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236281AbhJLXj0 (ORCPT ); Tue, 12 Oct 2021 19:39:26 -0400 Received: by mail-pf1-f171.google.com with SMTP id t15so807572pfl.13 for ; Tue, 12 Oct 2021 16:37:24 -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=yUIS35YvfxajMM/MJUPLa5VxKLB8uauvI3cezg8vG+maQj4GFBe9cSNU4GM13Qzw+q WMnp0bF4dMOnElk42fS1hVMRm0mwVJiM8CNSzcV8M5PEuyq6coIZkWS9MKyP5B+9xKRd SIDzMRU+0f7g8uYIaDZuDgqAJ9v5NfOyPdEfEsvpo3IZQ5G+3jVjpvY2tttpcMd8X1aw 5afd6dJttW35gnMNFVYvLA9k0p1FhYu4sZ3AX1l3myNKNU9hWOWnRQRU1TC0lHIB5J18 7XKuSlqpfJSkH416SnLWWZhUgFHXQJeXXCKyOlysHZ4hiybIPQos/Q4UwqHNVxtVmg51 Zxqg== X-Gm-Message-State: AOAM531wySQRmLnrSxrAfaV3Se8LrOE/T/KgC/rlm1iEzZwh7D23n5GW PoDf2C/oec8++08EDQKe9ks= X-Google-Smtp-Source: ABdhPJyANzNzPNlAffsxf05S9DRUybTYHPpgAh+q9XDQDVPpP9sml+TDyRa+kX6Ty92OPogFHllIIQ== X-Received: by 2002:a05:6a00:d63:b0:44d:186d:c4c0 with SMTP id n35-20020a056a000d6300b0044d186dc4c0mr15561899pfv.47.1634081843738; Tue, 12 Oct 2021 16:37:23 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.37.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:37:23 -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 v4 41/46] scsi: qla4xxx: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:53 -0700 Message-Id: <20211012233558.4066756-42-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35:54 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: 12554053 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 AB53CC433FE for ; Tue, 12 Oct 2021 23:37:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9582F60E54 for ; Tue, 12 Oct 2021 23:37:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236268AbhJLXjd (ORCPT ); Tue, 12 Oct 2021 19:39:33 -0400 Received: from mail-pj1-f51.google.com ([209.85.216.51]:55182 "EHLO mail-pj1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236300AbhJLXj1 (ORCPT ); Tue, 12 Oct 2021 19:39:27 -0400 Received: by mail-pj1-f51.google.com with SMTP id np13so789137pjb.4 for ; Tue, 12 Oct 2021 16:37:25 -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=k6ZKTsSwM+1db8POSnFG5TKh7DeK5z1f5BYtThqUwFfFjgHOB59+LClELrrsL3905b H/+Pl9kO8pHEdD04e/RVszq5vnPkx9NcMDjvWYWSfOsOycNQHnTF6Jbwr0/UVqA7+da6 TDyJGHLJI58ae1UbiD60+sDF74syiVZwgAFgZp3hYucvXgzc+2sRCLVchBpEQYfXqvtp esJ/ZsPGWbRv6bJ4Edn7EQ/vaq27BbUAiaaBptveCpWVNKfz0hmkRLW8v9b7YXlXJtQM 8VtoR732e2aA2pSqskBoHH+pvFdeW+GFKtYYUn8D0gg04ja7h9bKjshDsiXigNNY1jS7 ixVg== X-Gm-Message-State: AOAM532KM3YeImDsfku9NQNCnz0SzI7hY1LBc9zcVhaU35nYT+al7rip J6fdnPvBtFRKBri91EyyL3M= X-Google-Smtp-Source: ABdhPJwcusHmSUwjylqXicdNVgbuAikAdW9B/LkukWhcALQ7iaU1HdBEN0TZ0oTyiGOikKVYQntKHw== X-Received: by 2002:a17:902:e202:b0:13f:398d:97b0 with SMTP id u2-20020a170902e20200b0013f398d97b0mr14366106plb.53.1634081845188; Tue, 12 Oct 2021 16:37:25 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.37.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:37:24 -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 v4 42/46] scsi: smartpqi: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:54 -0700 Message-Id: <20211012233558.4066756-43-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35:55 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: 12554055 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 A04F8C4332F for ; Tue, 12 Oct 2021 23:37:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 88E6160EBB for ; Tue, 12 Oct 2021 23:37:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236189AbhJLXjd (ORCPT ); Tue, 12 Oct 2021 19:39:33 -0400 Received: from mail-pj1-f48.google.com ([209.85.216.48]:40739 "EHLO mail-pj1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236113AbhJLXj3 (ORCPT ); Tue, 12 Oct 2021 19:39:29 -0400 Received: by mail-pj1-f48.google.com with SMTP id pf6-20020a17090b1d8600b0019fa884ab85so3032619pjb.5 for ; Tue, 12 Oct 2021 16:37:27 -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=oYEMunX8p9u5aUwMCzXo6SvrhVs0UBKah3oNMgepaB7etyNGFkrTNOub5arGViNzmi liv4pBZlM1ESjQRECtvPXG+07LwKlaDP/GZnYMlvafKGwjH6okOjRWEdaGApU4vNgQpg 8mMmSMPGOWcdLQs67Qy8X7f4ZM0DB3thC3HEB48ORyXQ6FBQ6LSr/7bL/ON2uz3WtBsm fFaPjf+Ydmyj1yq6SFuAWWfLOR5I0yhwO9fYpFAy+tTlH5h9tIuufUlcnWlpJuOjixof pjCqfWIrd40zsLOndrjzW8A09R/xXqjU8UaZ6kbUTucxRxo/+f0f4NS+D/LbS3Y8G6qi TdVg== X-Gm-Message-State: AOAM532Vx9cKFBn1PXPpJaPJK9Up0tXE9CNlbNruu+4uLIkB46IgJJJQ ZMaxl6NiLaRNakru+10e8Ls= X-Google-Smtp-Source: ABdhPJyjxjZNui5GokBWiajsbEChicTZz/c0AV7Rnvk1bmOToyH1bho27KsyP/T/4TsAqz2148Wu4A== X-Received: by 2002:a17:90a:7d11:: with SMTP id g17mr9424016pjl.19.1634081846652; Tue, 12 Oct 2021 16:37:26 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.37.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:37:26 -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 v4 43/46] scsi: snic: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:55 -0700 Message-Id: <20211012233558.4066756-44-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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 Tue Oct 12 23:35:56 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: 12554057 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 A5238C433F5 for ; Tue, 12 Oct 2021 23:37:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8702760E94 for ; Tue, 12 Oct 2021 23:37:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236300AbhJLXjf (ORCPT ); Tue, 12 Oct 2021 19:39:35 -0400 Received: from mail-pl1-f175.google.com ([209.85.214.175]:46811 "EHLO mail-pl1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236158AbhJLXjd (ORCPT ); Tue, 12 Oct 2021 19:39:33 -0400 Received: by mail-pl1-f175.google.com with SMTP id 21so549354plo.13 for ; Tue, 12 Oct 2021 16:37: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=pv7T7AOubRmQ4NM+lOBXb57SuRh0StVaz5A6kAV5rhU=; b=Fw3dhpBg0pQ53r2u9Y2EjtlmDcuAXoB37Hl0da5nsCF9g2zp6fwn0cdrg/eBdw/X2z BZOHGrhg7zVA455AVkEzDkAAn3YKjIJqGifVsMlpuuxMzg/PbMsg7S4iOJQQ9P2bd6t4 leBfre4YEptfPev3CWq7IXlShwYyCNI9/hAQGKtx3L9ehkTEd/H2vDtL66afnaScabaX RDqwfVJqafOJSTTJATV5DxzOU0+Qwhf+mIX4DC8If2wytzFDPXYbayhm6+1ICBY1uLJG YQNxEqhW2h5gB1ehkzm/iibOX6g2oWC5g7DRuPD4+NuGzDT1fRxmka4ppW8N2Ilr9t4P OJxA== X-Gm-Message-State: AOAM5317d73tJyC0g/9unZQWqUHD5ZaYO93ksBzwRB0GyCSoZCnqRXPB wQMAZ2HIRDDFR/R6AwbYwL7HftHmfMDq9A== X-Google-Smtp-Source: ABdhPJzldofzQFIy9IwPXyIgijm3M6OSv57C6sHAqWxjA41k0cpQg+adVUIQydFqSrx6tVENnRkkyQ== X-Received: by 2002:a17:90a:ec17:: with SMTP id l23mr9434502pjy.184.1634081851136; Tue, 12 Oct 2021 16:37:31 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.37.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:37:30 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , David Kershner , Greg Kroah-Hartman , Song Chen , "Fabio M. De Francesco" , Dan Carpenter Subject: [PATCH v4 44/46] scsi: unisys: Remove the shost_attrs member Date: Tue, 12 Oct 2021 16:35:56 -0700 Message-Id: <20211012233558.4066756-45-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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. Acked-by: David Kershner Acked-by: Greg Kroah-Hartman Signed-off-by: Bart Van Assche --- 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 Tue Oct 12 23:35:57 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: 12554059 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 41E26C433EF for ; Tue, 12 Oct 2021 23:37:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E6D460ED4 for ; Tue, 12 Oct 2021 23:37:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236158AbhJLXjg (ORCPT ); Tue, 12 Oct 2021 19:39:36 -0400 Received: from mail-pg1-f179.google.com ([209.85.215.179]:33649 "EHLO mail-pg1-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236297AbhJLXjf (ORCPT ); Tue, 12 Oct 2021 19:39:35 -0400 Received: by mail-pg1-f179.google.com with SMTP id a73so594320pge.0 for ; Tue, 12 Oct 2021 16:37:33 -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=0/gRYdV8ppD542yrylViIFRkjZwU5xUz0hfGUfTZhAQ=; b=NNpHxJiz1pJcdFZ1vteXUHPVFBs0xnw/+U/Md3XdyyVAgeSXqSpvbLqju4bkSnLTUc uTVkLJ5/x3IrUMBT146pdyu8scg6TI6kHN5UubBQJyrZodaxW1UiJdD8BICLyBHrNt41 BBOCvyAiZLDuzOA3uZ4vdPQQaa+NkhJWdSp1K6rm3UK+P1CgC65OZ8olPXH9LtTdtNHe GabCmmYd0I9o3IW0uumP2udAe9wb2JdUEXVJj0w75zUwea56DD59tXc2ztz8wS6QZjq4 3TTLd2wZBTcjsQc1lnMXmsnowtaGbqOpUiCnjv8owkcFxyuuR2TdZIXL04gVAAgecQAL bXTw== X-Gm-Message-State: AOAM530aObqak3m8Mu14xFokaXg0BxMbHCuD8I1n7RbU2DiCNiEkoArL JaAvnDw3/mtVosQLYN8ha4E= X-Google-Smtp-Source: ABdhPJweao+Qlb1xH9ytbNb6/j5d8qa3FEePLO6XQR1jzd6uDlI39q9r2ERR3AXzOgWi9WZh+4D6Xg== X-Received: by 2002:a65:64d7:: with SMTP id t23mr24867798pgv.237.1634081852452; Tue, 12 Oct 2021 16:37:32 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.37.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:37:32 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Greg Kroah-Hartman , Alan Stern Subject: [PATCH v4 45/46] scsi: usb: Switch to attribute groups Date: Tue, 12 Oct 2021 16:35:57 -0700 Message-Id: <20211012233558.4066756-46-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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. Acked-by: Greg Kroah-Hartman Signed-off-by: Bart Van Assche --- 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 Tue Oct 12 23:35:58 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: 12554061 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 4042EC433F5 for ; Tue, 12 Oct 2021 23:37:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 25D0B60E94 for ; Tue, 12 Oct 2021 23:37:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236259AbhJLXjh (ORCPT ); Tue, 12 Oct 2021 19:39:37 -0400 Received: from mail-pf1-f177.google.com ([209.85.210.177]:45045 "EHLO mail-pf1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236281AbhJLXjg (ORCPT ); Tue, 12 Oct 2021 19:39:36 -0400 Received: by mail-pf1-f177.google.com with SMTP id w6so818129pfd.11 for ; Tue, 12 Oct 2021 16:37: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=2wlaencmBZXG80fUDiOzKyqvkgiWrECJ2hbHOZjvYSU=; b=Qw+zUSdojne0dLbsHEkbI7XQaMJnvkb+Bc7eXylLYSAWBJTVZkvQ4IZsStHOK/TX7g lyxf6y5GTNB2jDAT7XKcQL9VsOQyKxyQIUU7cPfZGSvebdaWweE2Xuf2iMnYAMXe4Z5a qVkA5jfO6D0BHyqeLP1JPEVrHdul8Y4C6+6Rhxs+DpaV9v6c3HE21dHYRZPHAy9+VqXg RcSri0bw1ZH2hb6G3Rk30l9t8ntW6iSfrItkwWUrpelIfEOXeie6ZF0vsKGNsjW8srTR oMoSY7x4hcvERiVsp1t+fzJ2XSOUv2lW7X35gASN9uHbb94knd4nxfh0exIxB3acx1Nb Xn2A== X-Gm-Message-State: AOAM530iwYBiMtRfHk06Ww2QJaPBYXaF5Xxj6u8qRbrxG3vrXsUCMnLr eFDzJc9VmWCEm/ZszyIWuDM= X-Google-Smtp-Source: ABdhPJw8j6HoRF9+9aynrOLpTi5FfpuBM+S09azTCMUkWa1IxW8jH+HL0vt+gdLCAXefjjCknQcf7g== X-Received: by 2002:a63:490d:: with SMTP id w13mr25431841pga.481.1634081854151; Tue, 12 Oct 2021 16:37:34 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:201:8c1a:acb2:4eff:5d13]) by smtp.gmail.com with ESMTPSA id pi9sm4336676pjb.31.2021.10.12.16.37.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 16:37:33 -0700 (PDT) From: Bart Van Assche To: "Martin K . Petersen" Cc: linux-scsi@vger.kernel.org, Bart Van Assche , Greg Kroah-Hartman , Benjamin Block , "James E.J. Bottomley" Subject: [PATCH v4 46/46] scsi: core: Remove two host template members that are no longer used Date: Tue, 12 Oct 2021 16:35:58 -0700 Message-Id: <20211012233558.4066756-47-bvanassche@acm.org> X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog In-Reply-To: <20211012233558.4066756-1-bvanassche@acm.org> References: <20211012233558.4066756-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. Additionally, remove the 'lld_attr_group' members and also the scsi_convert_dev_attrs() function. Cc: Greg Kroah-Hartman Reviewed-by: Benjamin Block Signed-off-by: Bart Van Assche --- 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