mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-01 10:33:27 +00:00
PCI: return correct value when writing to the "reset" attribute
A successful write() to the "reset" sysfs attribute should return the number of bytes written, not 0. Otherwise userspace (bash) retries the write over and over again. Acked-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Michal Schmidt <mschmidt@redhat.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
This commit is contained in:
parent
3196180a54
commit
447c5dd733
1 changed files with 6 additions and 1 deletions
|
@ -960,7 +960,12 @@ static ssize_t reset_store(struct device *dev,
|
|||
|
||||
if (val != 1)
|
||||
return -EINVAL;
|
||||
return pci_reset_function(pdev);
|
||||
|
||||
result = pci_reset_function(pdev);
|
||||
if (result < 0)
|
||||
return result;
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static struct device_attribute reset_attr = __ATTR(reset, 0200, NULL, reset_store);
|
||||
|
|
Loading…
Reference in a new issue