diff options
Diffstat (limited to 'drivers/s390/block/dasd_devmap.c')
-rw-r--r-- | drivers/s390/block/dasd_devmap.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c index 1629b27c48ab..f576f243cd93 100644 --- a/drivers/s390/block/dasd_devmap.c +++ b/drivers/s390/block/dasd_devmap.c | |||
@@ -715,10 +715,51 @@ dasd_discipline_show(struct device *dev, struct device_attribute *attr, char *bu | |||
715 | 715 | ||
716 | static DEVICE_ATTR(discipline, 0444, dasd_discipline_show, NULL); | 716 | static DEVICE_ATTR(discipline, 0444, dasd_discipline_show, NULL); |
717 | 717 | ||
718 | /* | ||
719 | * extended error-reporting | ||
720 | */ | ||
721 | static ssize_t | ||
722 | dasd_eer_show(struct device *dev, struct device_attribute *attr, char *buf) | ||
723 | { | ||
724 | struct dasd_devmap *devmap; | ||
725 | int eer_flag; | ||
726 | |||
727 | devmap = dasd_find_busid(dev->bus_id); | ||
728 | if (!IS_ERR(devmap) && devmap->device) | ||
729 | eer_flag = dasd_eer_enabled(devmap->device); | ||
730 | else | ||
731 | eer_flag = 0; | ||
732 | return snprintf(buf, PAGE_SIZE, eer_flag ? "1\n" : "0\n"); | ||
733 | } | ||
734 | |||
735 | static ssize_t | ||
736 | dasd_eer_store(struct device *dev, struct device_attribute *attr, | ||
737 | const char *buf, size_t count) | ||
738 | { | ||
739 | struct dasd_devmap *devmap; | ||
740 | int rc; | ||
741 | |||
742 | devmap = dasd_devmap_from_cdev(to_ccwdev(dev)); | ||
743 | if (IS_ERR(devmap)) | ||
744 | return PTR_ERR(devmap); | ||
745 | if (!devmap->device) | ||
746 | return count; | ||
747 | if (buf[0] == '1') { | ||
748 | rc = dasd_eer_enable(devmap->device); | ||
749 | if (rc) | ||
750 | return rc; | ||
751 | } else | ||
752 | dasd_eer_disable(devmap->device); | ||
753 | return count; | ||
754 | } | ||
755 | |||
756 | static DEVICE_ATTR(eer_enabled, 0644, dasd_eer_show, dasd_eer_store); | ||
757 | |||
718 | static struct attribute * dasd_attrs[] = { | 758 | static struct attribute * dasd_attrs[] = { |
719 | &dev_attr_readonly.attr, | 759 | &dev_attr_readonly.attr, |
720 | &dev_attr_discipline.attr, | 760 | &dev_attr_discipline.attr, |
721 | &dev_attr_use_diag.attr, | 761 | &dev_attr_use_diag.attr, |
762 | &dev_attr_eer_enabled.attr, | ||
722 | NULL, | 763 | NULL, |
723 | }; | 764 | }; |
724 | 765 | ||