diff options
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 1a766b284cfc..87f90c4f08e9 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -294,9 +294,6 @@ qla2x00_sysfs_read_vpd(struct kobject *kobj, char *buf, loff_t off, | |||
294 | if (!capable(CAP_SYS_ADMIN) || off != 0) | 294 | if (!capable(CAP_SYS_ADMIN) || off != 0) |
295 | return 0; | 295 | return 0; |
296 | 296 | ||
297 | if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha)) | ||
298 | return -ENOTSUPP; | ||
299 | |||
300 | /* Read NVRAM. */ | 297 | /* Read NVRAM. */ |
301 | spin_lock_irqsave(&ha->hardware_lock, flags); | 298 | spin_lock_irqsave(&ha->hardware_lock, flags); |
302 | ha->isp_ops.read_nvram(ha, (uint8_t *)buf, ha->vpd_base, ha->vpd_size); | 299 | ha->isp_ops.read_nvram(ha, (uint8_t *)buf, ha->vpd_base, ha->vpd_size); |
@@ -316,9 +313,6 @@ qla2x00_sysfs_write_vpd(struct kobject *kobj, char *buf, loff_t off, | |||
316 | if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->vpd_size) | 313 | if (!capable(CAP_SYS_ADMIN) || off != 0 || count != ha->vpd_size) |
317 | return 0; | 314 | return 0; |
318 | 315 | ||
319 | if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha)) | ||
320 | return -ENOTSUPP; | ||
321 | |||
322 | /* Write NVRAM. */ | 316 | /* Write NVRAM. */ |
323 | spin_lock_irqsave(&ha->hardware_lock, flags); | 317 | spin_lock_irqsave(&ha->hardware_lock, flags); |
324 | ha->isp_ops.write_nvram(ha, (uint8_t *)buf, ha->vpd_base, count); | 318 | ha->isp_ops.write_nvram(ha, (uint8_t *)buf, ha->vpd_base, count); |
@@ -395,10 +389,12 @@ qla2x00_alloc_sysfs_attr(scsi_qla_host_t *ha) | |||
395 | sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_optrom_attr); | 389 | sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_optrom_attr); |
396 | sysfs_create_bin_file(&host->shost_gendev.kobj, | 390 | sysfs_create_bin_file(&host->shost_gendev.kobj, |
397 | &sysfs_optrom_ctl_attr); | 391 | &sysfs_optrom_ctl_attr); |
398 | sysfs_create_bin_file(&host->shost_gendev.kobj, &sysfs_vpd_attr); | 392 | if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { |
399 | if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) | 393 | sysfs_create_bin_file(&host->shost_gendev.kobj, |
394 | &sysfs_vpd_attr); | ||
400 | sysfs_create_bin_file(&host->shost_gendev.kobj, | 395 | sysfs_create_bin_file(&host->shost_gendev.kobj, |
401 | &sysfs_sfp_attr); | 396 | &sysfs_sfp_attr); |
397 | } | ||
402 | } | 398 | } |
403 | 399 | ||
404 | void | 400 | void |
@@ -411,10 +407,12 @@ qla2x00_free_sysfs_attr(scsi_qla_host_t *ha) | |||
411 | sysfs_remove_bin_file(&host->shost_gendev.kobj, &sysfs_optrom_attr); | 407 | sysfs_remove_bin_file(&host->shost_gendev.kobj, &sysfs_optrom_attr); |
412 | sysfs_remove_bin_file(&host->shost_gendev.kobj, | 408 | sysfs_remove_bin_file(&host->shost_gendev.kobj, |
413 | &sysfs_optrom_ctl_attr); | 409 | &sysfs_optrom_ctl_attr); |
414 | sysfs_remove_bin_file(&host->shost_gendev.kobj, &sysfs_vpd_attr); | 410 | if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { |
415 | if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) | 411 | sysfs_remove_bin_file(&host->shost_gendev.kobj, |
412 | &sysfs_vpd_attr); | ||
416 | sysfs_remove_bin_file(&host->shost_gendev.kobj, | 413 | sysfs_remove_bin_file(&host->shost_gendev.kobj, |
417 | &sysfs_sfp_attr); | 414 | &sysfs_sfp_attr); |
415 | } | ||
418 | 416 | ||
419 | if (ha->beacon_blink_led == 1) | 417 | if (ha->beacon_blink_led == 1) |
420 | ha->isp_ops.beacon_off(ha); | 418 | ha->isp_ops.beacon_off(ha); |