Commit d6354683 authored by Tomas Henzl's avatar Tomas Henzl Committed by Martin K. Petersen

scsi: megaraid_sas: use DEVICE_ATTR_{RO, RW}

Use existing macros.  No functional change.
Signed-off-by: default avatarTomas Henzl <thenzl@redhat.com>
Acked-by: default avatarSumit Saxena <sumit.saxena@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent ea14e462
...@@ -3121,7 +3121,7 @@ megasas_service_aen(struct megasas_instance *instance, struct megasas_cmd *cmd) ...@@ -3121,7 +3121,7 @@ megasas_service_aen(struct megasas_instance *instance, struct megasas_cmd *cmd)
} }
static ssize_t static ssize_t
megasas_fw_crash_buffer_store(struct device *cdev, fw_crash_buffer_store(struct device *cdev,
struct device_attribute *attr, const char *buf, size_t count) struct device_attribute *attr, const char *buf, size_t count)
{ {
struct Scsi_Host *shost = class_to_shost(cdev); struct Scsi_Host *shost = class_to_shost(cdev);
...@@ -3140,7 +3140,7 @@ megasas_fw_crash_buffer_store(struct device *cdev, ...@@ -3140,7 +3140,7 @@ megasas_fw_crash_buffer_store(struct device *cdev,
} }
static ssize_t static ssize_t
megasas_fw_crash_buffer_show(struct device *cdev, fw_crash_buffer_show(struct device *cdev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct Scsi_Host *shost = class_to_shost(cdev); struct Scsi_Host *shost = class_to_shost(cdev);
...@@ -3182,7 +3182,7 @@ megasas_fw_crash_buffer_show(struct device *cdev, ...@@ -3182,7 +3182,7 @@ megasas_fw_crash_buffer_show(struct device *cdev,
} }
static ssize_t static ssize_t
megasas_fw_crash_buffer_size_show(struct device *cdev, fw_crash_buffer_size_show(struct device *cdev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct Scsi_Host *shost = class_to_shost(cdev); struct Scsi_Host *shost = class_to_shost(cdev);
...@@ -3194,7 +3194,7 @@ megasas_fw_crash_buffer_size_show(struct device *cdev, ...@@ -3194,7 +3194,7 @@ megasas_fw_crash_buffer_size_show(struct device *cdev,
} }
static ssize_t static ssize_t
megasas_fw_crash_state_store(struct device *cdev, fw_crash_state_store(struct device *cdev,
struct device_attribute *attr, const char *buf, size_t count) struct device_attribute *attr, const char *buf, size_t count)
{ {
struct Scsi_Host *shost = class_to_shost(cdev); struct Scsi_Host *shost = class_to_shost(cdev);
...@@ -3229,7 +3229,7 @@ megasas_fw_crash_state_store(struct device *cdev, ...@@ -3229,7 +3229,7 @@ megasas_fw_crash_state_store(struct device *cdev,
} }
static ssize_t static ssize_t
megasas_fw_crash_state_show(struct device *cdev, fw_crash_state_show(struct device *cdev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct Scsi_Host *shost = class_to_shost(cdev); struct Scsi_Host *shost = class_to_shost(cdev);
...@@ -3240,14 +3240,14 @@ megasas_fw_crash_state_show(struct device *cdev, ...@@ -3240,14 +3240,14 @@ megasas_fw_crash_state_show(struct device *cdev,
} }
static ssize_t static ssize_t
megasas_page_size_show(struct device *cdev, page_size_show(struct device *cdev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
return snprintf(buf, PAGE_SIZE, "%ld\n", (unsigned long)PAGE_SIZE - 1); return snprintf(buf, PAGE_SIZE, "%ld\n", (unsigned long)PAGE_SIZE - 1);
} }
static ssize_t static ssize_t
megasas_ldio_outstanding_show(struct device *cdev, struct device_attribute *attr, ldio_outstanding_show(struct device *cdev, struct device_attribute *attr,
char *buf) char *buf)
{ {
struct Scsi_Host *shost = class_to_shost(cdev); struct Scsi_Host *shost = class_to_shost(cdev);
...@@ -3257,7 +3257,7 @@ megasas_ldio_outstanding_show(struct device *cdev, struct device_attribute *attr ...@@ -3257,7 +3257,7 @@ megasas_ldio_outstanding_show(struct device *cdev, struct device_attribute *attr
} }
static ssize_t static ssize_t
megasas_fw_cmds_outstanding_show(struct device *cdev, fw_cmds_outstanding_show(struct device *cdev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct Scsi_Host *shost = class_to_shost(cdev); struct Scsi_Host *shost = class_to_shost(cdev);
...@@ -3267,7 +3267,7 @@ megasas_fw_cmds_outstanding_show(struct device *cdev, ...@@ -3267,7 +3267,7 @@ megasas_fw_cmds_outstanding_show(struct device *cdev,
} }
static ssize_t static ssize_t
megasas_dump_system_regs_show(struct device *cdev, dump_system_regs_show(struct device *cdev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct Scsi_Host *shost = class_to_shost(cdev); struct Scsi_Host *shost = class_to_shost(cdev);
...@@ -3278,7 +3278,7 @@ megasas_dump_system_regs_show(struct device *cdev, ...@@ -3278,7 +3278,7 @@ megasas_dump_system_regs_show(struct device *cdev,
} }
static ssize_t static ssize_t
megasas_raid_map_id_show(struct device *cdev, struct device_attribute *attr, raid_map_id_show(struct device *cdev, struct device_attribute *attr,
char *buf) char *buf)
{ {
struct Scsi_Host *shost = class_to_shost(cdev); struct Scsi_Host *shost = class_to_shost(cdev);
...@@ -3289,22 +3289,14 @@ megasas_raid_map_id_show(struct device *cdev, struct device_attribute *attr, ...@@ -3289,22 +3289,14 @@ megasas_raid_map_id_show(struct device *cdev, struct device_attribute *attr,
(unsigned long)instance->map_id); (unsigned long)instance->map_id);
} }
static DEVICE_ATTR(fw_crash_buffer, S_IRUGO | S_IWUSR, static DEVICE_ATTR_RW(fw_crash_buffer);
megasas_fw_crash_buffer_show, megasas_fw_crash_buffer_store); static DEVICE_ATTR_RO(fw_crash_buffer_size);
static DEVICE_ATTR(fw_crash_buffer_size, S_IRUGO, static DEVICE_ATTR_RW(fw_crash_state);
megasas_fw_crash_buffer_size_show, NULL); static DEVICE_ATTR_RO(page_size);
static DEVICE_ATTR(fw_crash_state, S_IRUGO | S_IWUSR, static DEVICE_ATTR_RO(ldio_outstanding);
megasas_fw_crash_state_show, megasas_fw_crash_state_store); static DEVICE_ATTR_RO(fw_cmds_outstanding);
static DEVICE_ATTR(page_size, S_IRUGO, static DEVICE_ATTR_RO(dump_system_regs);
megasas_page_size_show, NULL); static DEVICE_ATTR_RO(raid_map_id);
static DEVICE_ATTR(ldio_outstanding, S_IRUGO,
megasas_ldio_outstanding_show, NULL);
static DEVICE_ATTR(fw_cmds_outstanding, S_IRUGO,
megasas_fw_cmds_outstanding_show, NULL);
static DEVICE_ATTR(dump_system_regs, S_IRUGO,
megasas_dump_system_regs_show, NULL);
static DEVICE_ATTR(raid_map_id, S_IRUGO,
megasas_raid_map_id_show, NULL);
struct device_attribute *megaraid_host_attrs[] = { struct device_attribute *megaraid_host_attrs[] = {
&dev_attr_fw_crash_buffer_size, &dev_attr_fw_crash_buffer_size,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment