All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: "Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Subject: [PATCH v2 17/46] scsi: csiostor: Switch to attribute groups
Date: Thu,  7 Oct 2021 14:18:23 -0700	[thread overview]
Message-ID: <20211007211852.256007-18-bvanassche@acm.org> (raw)
In-Reply-To: <20211007211852.256007-1-bvanassche@acm.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 <bvanassche@acm.org>
---
 drivers/scsi/csiostor/csio_scsi.c | 38 +++++++++++++++++++++++--------
 1 file changed, 28 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/csiostor/csio_scsi.c b/drivers/scsi/csiostor/csio_scsi.c
index 3b2eb6ce1fcf..b7ef0a6cae22 100644
--- a/drivers/scsi/csiostor/csio_scsi.c
+++ b/drivers/scsi/csiostor/csio_scsi.c
@@ -1460,14 +1460,23 @@ 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,
 };
 
+static const struct attribute_group csio_fcoe_lport_attr_group = {
+	.attrs = csio_fcoe_lport_attrs
+};
+
+static const struct attribute_group *csio_fcoe_lport_attr_groups[] = {
+	&csio_fcoe_lport_attr_group,
+	NULL
+};
+
 static ssize_t
 csio_show_num_reg_rnodes(struct device *dev,
 		     struct device_attribute *attr, char *buf)
@@ -1479,12 +1488,21 @@ 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,
 };
 
+static const struct attribute_group csio_fcoe_vport_attr_group = {
+	.attrs = csio_fcoe_vport_attrs
+};
+
+static const struct attribute_group *csio_fcoe_vport_attr_groups[] = {
+	&csio_fcoe_vport_attr_group,
+	NULL
+};
+
 static inline uint32_t
 csio_scsi_copy_to_sgl(struct csio_hw *hw, struct csio_ioreq *req)
 {
@@ -2277,7 +2295,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_attr_groups,
 	.max_sectors		= CSIO_MAX_SECTOR_SIZE,
 };
 
@@ -2296,7 +2314,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_attr_groups,
 	.max_sectors		= CSIO_MAX_SECTOR_SIZE,
 };
 

  parent reply	other threads:[~2021-10-07 21:19 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-07 21:18 [PATCH v2 00/46] Register SCSI sysfs attributes earlier Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 01/46] scsi: core: Register " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 02/46] ata: Switch to attribute groups Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 03/46] firewire: sbp2: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 04/46] RDMA/srp: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 05/46] scsi: message: fusion: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 06/46] scsi: zfcp: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 07/46] scsi: 3w-9xxx: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 08/46] scsi: 3w-sas: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 09/46] scsi: 3w-xxxx: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 10/46] scsi: 53c700: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 11/46] scsi: aacraid: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 12/46] scsi: arcmsr: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 13/46] scsi: be2iscsi: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 14/46] scsi: bfa: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 15/46] scsi: bnx2fc: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 16/46] scsi: bnx2i: " Bart Van Assche
2021-10-07 21:18 ` Bart Van Assche [this message]
2021-10-07 21:18 ` [PATCH v2 18/46] scsi: cxlflash: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 19/46] scsi: fnic: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 20/46] scsi: hisi_sas: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 21/46] scsi: hpsa: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 22/46] scsi: hptiop: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 23/46] scsi: ibmvscsi: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 24/46] scsi: ibmvfc: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 25/46] scsi: ipr: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 26/46] scsi: isci: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 27/46] scsi: lpfc: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 28/46] scsi: megaraid: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 29/46] scsi: mpt3sas: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 30/46] scsi: mvsas: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 31/46] scsi: myrb: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 32/46] scsi: myrs: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 33/46] scsi: ncr53c8xx: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 34/46] scsi: sym53c500_cs: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 35/46] scsi: pm8001: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 36/46] scsi: pmcraid: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 37/46] scsi: qedf: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 38/46] scsi: qedi: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 39/46] scsi: qla2xxx: Remove a declaration Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 40/46] scsi: qla2xxx: Switch to attribute groups Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 41/46] scsi: qla4xxx: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 42/46] scsi: smartpqi: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 43/46] scsi: snic: " Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 44/46] scsi: unisys: Remove the shost_attrs member Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 45/46] scsi: usb: Switch to attribute groups Bart Van Assche
2021-10-08  5:39   ` Greg Kroah-Hartman
2021-10-08 20:19     ` Bart Van Assche
2021-10-07 21:18 ` [PATCH v2 46/46] scsi: core: Remove two host template members that are no longer used Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211007211852.256007-18-bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=jejb@linux.ibm.com \
    --cc=jiapeng.chong@linux.alibaba.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.