diff options
author | Lukas Wunner <lukas@wunner.de> | 2024-04-20 22:00:06 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-05-04 17:37:04 +0200 |
commit | 9bb8e30611a4c9a28cb96ea64d1694202ac67da8 (patch) | |
tree | c51b8bc3bf55f0b34fe90732e40bf430ffdad325 /drivers/scsi/mvsas | |
parent | 3182459b7bff642eb968d6203a08aea3862436c1 (diff) |
scsi: Use device_show_string() helper for sysfs attributes
Deduplicate sysfs ->show() callbacks which expose a string at a static
memory location. Use the newly introduced device_show_string() helper
in the driver core instead by declaring those sysfs attributes with
DEVICE_STRING_ATTR_RO().
No functional change intended.
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Link: https://lore.kernel.org/r/b11792137186f5a6794f12fdf891d0c6d51b3557.1713608122.git.lukas@wunner.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/scsi/mvsas')
-rw-r--r-- | drivers/scsi/mvsas/mv_init.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c index 43ebb331e216..2a25d574feb9 100644 --- a/drivers/scsi/mvsas/mv_init.c +++ b/drivers/scsi/mvsas/mv_init.c @@ -691,13 +691,7 @@ static struct pci_driver mvs_pci_driver = { .remove = mvs_pci_remove, }; -static ssize_t driver_version_show(struct device *cdev, - struct device_attribute *attr, char *buffer) -{ - return sysfs_emit(buffer, "%s\n", DRV_VERSION); -} - -static DEVICE_ATTR_RO(driver_version); +static DEVICE_STRING_ATTR_RO(driver_version, 0444, DRV_VERSION); static ssize_t interrupt_coalescing_store(struct device *cdev, struct device_attribute *attr, @@ -772,7 +766,7 @@ static void __exit mvs_exit(void) } static struct attribute *mvst_host_attrs[] = { - &dev_attr_driver_version.attr, + &dev_attr_driver_version.attr.attr, &dev_attr_interrupt_coalescing.attr, NULL, }; |