diff options
author | Bart Van Assche <bvanassche@acm.org> | 2021-10-13 01:35:14 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-10-17 03:45:52 +0200 |
commit | c3f69c7f629ff53c75f335754ea41426b8e095de (patch) | |
tree | 67639f22fdf1550280865f9a57436f221532376f /drivers/ata/libata-sata.c | |
parent | scsi: core: Register sysfs attributes earlier (diff) | |
download | linux-c3f69c7f629ff53c75f335754ea41426b8e095de.tar.xz linux-c3f69c7f629ff53c75f335754ea41426b8e095de.zip |
scsi: ata: 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-3-bvanassche@acm.org
Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/ata/libata-sata.c')
-rw-r--r-- | drivers/ata/libata-sata.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c index 60418d872c12..4e88597aa9df 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, |