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

scsi: qedf: 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-38-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
232cb469 646bed7e

+14 -5
+1 -1
drivers/scsi/qedf/qedf.h
··· 498 498 extern struct qedf_ioreq *qedf_alloc_cmd(struct qedf_rport *fcport, 499 499 u8 cmd_type); 500 500 501 - extern struct device_attribute *qedf_host_attrs[]; 501 + extern const struct attribute_group *qedf_host_groups[]; 502 502 extern void qedf_cmd_timer_set(struct qedf_ctx *qedf, struct qedf_ioreq *io_req, 503 503 unsigned int timer_msec); 504 504 extern int qedf_init_mp_req(struct qedf_ioreq *io_req);
+12 -3
drivers/scsi/qedf/qedf_attr.c
··· 60 60 static DEVICE_ATTR_RO(fcoe_mac); 61 61 static DEVICE_ATTR_RO(fka_period); 62 62 63 - struct device_attribute *qedf_host_attrs[] = { 64 - &dev_attr_fcoe_mac, 65 - &dev_attr_fka_period, 63 + static struct attribute *qedf_host_attrs[] = { 64 + &dev_attr_fcoe_mac.attr, 65 + &dev_attr_fka_period.attr, 66 66 NULL, 67 + }; 68 + 69 + static const struct attribute_group qedf_host_attr_group = { 70 + .attrs = qedf_host_attrs 71 + }; 72 + 73 + const struct attribute_group *qedf_host_groups[] = { 74 + &qedf_host_attr_group, 75 + NULL 67 76 }; 68 77 69 78 extern const struct qed_fcoe_ops *qed_ops;
+1 -1
drivers/scsi/qedf/qedf_main.c
··· 986 986 .cmd_per_lun = 32, 987 987 .max_sectors = 0xffff, 988 988 .queuecommand = qedf_queuecommand, 989 - .shost_attrs = qedf_host_attrs, 989 + .shost_groups = qedf_host_groups, 990 990 .eh_abort_handler = qedf_eh_abort, 991 991 .eh_device_reset_handler = qedf_eh_device_reset, /* lun reset */ 992 992 .eh_target_reset_handler = qedf_eh_target_reset, /* target reset */