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

scsi: csiostor: Switch to attribute groups

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

Link: https://lore.kernel.org/r/20211012233558.4066756-18-bvanassche@acm.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Bart Van Assche and committed by
Martin K. Petersen
623cf762 eb78ac7a

+14 -10
+14 -10
drivers/scsi/csiostor/csio_scsi.c
··· 1460 1460 static DEVICE_ATTR(dbg_level, S_IRUGO | S_IWUSR, csio_show_dbg_level, 1461 1461 csio_store_dbg_level); 1462 1462 1463 - static struct device_attribute *csio_fcoe_lport_attrs[] = { 1464 - &dev_attr_hw_state, 1465 - &dev_attr_device_reset, 1466 - &dev_attr_disable_port, 1467 - &dev_attr_dbg_level, 1463 + static struct attribute *csio_fcoe_lport_attrs[] = { 1464 + &dev_attr_hw_state.attr, 1465 + &dev_attr_device_reset.attr, 1466 + &dev_attr_disable_port.attr, 1467 + &dev_attr_dbg_level.attr, 1468 1468 NULL, 1469 1469 }; 1470 + 1471 + ATTRIBUTE_GROUPS(csio_fcoe_lport); 1470 1472 1471 1473 static ssize_t 1472 1474 csio_show_num_reg_rnodes(struct device *dev, ··· 1481 1479 1482 1480 static DEVICE_ATTR(num_reg_rnodes, S_IRUGO, csio_show_num_reg_rnodes, NULL); 1483 1481 1484 - static struct device_attribute *csio_fcoe_vport_attrs[] = { 1485 - &dev_attr_num_reg_rnodes, 1486 - &dev_attr_dbg_level, 1482 + static struct attribute *csio_fcoe_vport_attrs[] = { 1483 + &dev_attr_num_reg_rnodes.attr, 1484 + &dev_attr_dbg_level.attr, 1487 1485 NULL, 1488 1486 }; 1487 + 1488 + ATTRIBUTE_GROUPS(csio_fcoe_vport); 1489 1489 1490 1490 static inline uint32_t 1491 1491 csio_scsi_copy_to_sgl(struct csio_hw *hw, struct csio_ioreq *req) ··· 2281 2277 .this_id = -1, 2282 2278 .sg_tablesize = CSIO_SCSI_MAX_SGE, 2283 2279 .cmd_per_lun = CSIO_MAX_CMD_PER_LUN, 2284 - .shost_attrs = csio_fcoe_lport_attrs, 2280 + .shost_groups = csio_fcoe_lport_groups, 2285 2281 .max_sectors = CSIO_MAX_SECTOR_SIZE, 2286 2282 }; 2287 2283 ··· 2300 2296 .this_id = -1, 2301 2297 .sg_tablesize = CSIO_SCSI_MAX_SGE, 2302 2298 .cmd_per_lun = CSIO_MAX_CMD_PER_LUN, 2303 - .shost_attrs = csio_fcoe_vport_attrs, 2299 + .shost_groups = csio_fcoe_vport_groups, 2304 2300 .max_sectors = CSIO_MAX_SECTOR_SIZE, 2305 2301 }; 2306 2302