Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 31894
b: refs/heads/master
c: 7914d00
h: refs/heads/master
v: v3
  • Loading branch information
Andrew Vasquez authored and James Bottomley committed Jun 26, 2006
1 parent 99eb9af commit 829ab18
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 88729e53a4798df20e7a7ef68e0a816f4a268da4
refs/heads/master: 7914d004bcff3e59ca7c0d628f9862fe6655429c
18 changes: 8 additions & 10 deletions trunk/drivers/scsi/qla2xxx/qla_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,6 @@ qla2x00_sysfs_read_vpd(struct kobject *kobj, char *buf, loff_t off,
if (!capable(CAP_SYS_ADMIN) || off != 0)
return 0;

if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha))
return -ENOTSUPP;

/* Read NVRAM. */
spin_lock_irqsave(&ha->hardware_lock, flags);
ha->isp_ops.read_nvram(ha, (uint8_t *)buf, ha->vpd_base, ha->vpd_size);
Expand All @@ -316,9 +313,6 @@ qla2x00_sysfs_write_vpd(struct kobject *kobj, char *buf, loff_t off,
if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->vpd_size)
return 0;

if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha))
return -ENOTSUPP;

/* Write NVRAM. */
spin_lock_irqsave(&ha->hardware_lock, flags);
ha->isp_ops.write_nvram(ha, (uint8_t *)buf, ha->vpd_base, count);
Expand Down Expand Up @@ -395,10 +389,12 @@ qla2x00_alloc_sysfs_attr(scsi_qla_host_t *ha)
sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_optrom_attr);
sysfs_create_bin_file(&host->shost_gendev.kobj,
&sysfs_optrom_ctl_attr);
sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_vpd_attr);
if (IS_QLA24XX(ha) || IS_QLA54XX(ha))
if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
sysfs_create_bin_file(&host->shost_gendev.kobj,
&sysfs_vpd_attr);
sysfs_create_bin_file(&host->shost_gendev.kobj,
&sysfs_sfp_attr);
}
}

void
Expand All @@ -411,10 +407,12 @@ qla2x00_free_sysfs_attr(scsi_qla_host_t *ha)
sysfs_remove_bin_file(&host->shost_gendev.kobj, &sysfs_optrom_attr);
sysfs_remove_bin_file(&host->shost_gendev.kobj,
&sysfs_optrom_ctl_attr);
sysfs_remove_bin_file(&host->shost_gendev.kobj, &sysfs_vpd_attr);
if (IS_QLA24XX(ha) || IS_QLA54XX(ha))
if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
sysfs_remove_bin_file(&host->shost_gendev.kobj,
&sysfs_vpd_attr);
sysfs_remove_bin_file(&host->shost_gendev.kobj,
&sysfs_sfp_attr);
}

if (ha->beacon_blink_led == 1)
ha->isp_ops.beacon_off(ha);
Expand Down

0 comments on commit 829ab18

Please sign in to comment.