{
        struct acpi_device *device = to_acpi_device(kobj);
        struct acpi_device_attribute *attribute = to_handle_attr(attr);
-       return attribute->show ? attribute->show(device, buf) : 0;
+       return attribute->show ? attribute->show(device, buf) : -EIO;
 }
 static ssize_t acpi_device_attr_store(struct kobject *kobj,
                struct attribute *attr, const char *buf, size_t len)
 {
        struct acpi_device *device = to_acpi_device(kobj);
        struct acpi_device_attribute *attribute = to_handle_attr(attr);
-       return attribute->store ? attribute->store(device, buf, len) : len;
+       return attribute->store ? attribute->store(device, buf, len) : -EIO;
 }
 
 static struct sysfs_ops acpi_device_sysfs_ops = {
 
        policy = cpufreq_cpu_get(policy->cpu);
        if (!policy)
                return -EINVAL;
-       ret = fattr->show ? fattr->show(policy,buf) : 0;
+       ret = fattr->show ? fattr->show(policy,buf) : -EIO;
        cpufreq_cpu_put(policy);
        return ret;
 }
        policy = cpufreq_cpu_get(policy->cpu);
        if (!policy)
                return -EINVAL;
-       ret = fattr->store ? fattr->store(policy,buf,count) : 0;
+       ret = fattr->store ? fattr->store(policy,buf,count) : -EIO;
        cpufreq_cpu_put(policy);
        return ret;
 }
 
 {
        struct edd_device *dev = to_edd_device(kobj);
        struct edd_attribute *edd_attr = to_edd_attr(attr);
-       ssize_t ret = 0;
+       ssize_t ret = -EIO;
 
        if (edd_attr->show)
                ret = edd_attr->show(dev, buf);
 
 {
        struct efivar_entry *var = to_efivar_entry(kobj);
        struct efivar_attribute *efivar_attr = to_efivar_attr(attr);
-       ssize_t ret = 0;
+       ssize_t ret = -EIO;
 
        if (!capable(CAP_SYS_ADMIN))
                return -EACCES;
 {
        struct efivar_entry *var = to_efivar_entry(kobj);
        struct efivar_attribute *efivar_attr = to_efivar_attr(attr);
-       ssize_t ret = 0;
+       ssize_t ret = -EIO;
 
        if (!capable(CAP_SYS_ADMIN))
                return -EACCES;
 
        struct ib_port *p = container_of(kobj, struct ib_port, kobj);
 
        if (!port_attr->show)
-               return 0;
+               return -EIO;
 
        return port_attr->show(p, port_attr, buf);
 }
 
        mk = to_module_kobject(kobj);
 
        if (!attribute->show)
-               return -EPERM;
+               return -EIO;
 
        if (!try_module_get(mk->mod))
                return -ENODEV;
        mk = to_module_kobject(kobj);
 
        if (!attribute->store)
-               return -EPERM;
+               return -EIO;
 
        if (!try_module_get(mk->mod))
                return -ENODEV;
 
        struct seclvl_obj *obj = container_of(kobj, struct seclvl_obj, kobj);
        struct seclvl_attribute *attribute =
            container_of(attr, struct seclvl_attribute, attr);
-       return (attribute->store ? attribute->store(obj, buf, len) : 0);
+       return attribute->store ? attribute->store(obj, buf, len) : -EIO;
 }
 
 static ssize_t
        struct seclvl_obj *obj = container_of(kobj, struct seclvl_obj, kobj);
        struct seclvl_attribute *attribute =
            container_of(attr, struct seclvl_attribute, attr);
-       return (attribute->show ? attribute->show(obj, buf) : 0);
+       return attribute->show ? attribute->show(obj, buf) : -EIO;
 }
 
 /**